Patch "mei: use kvmalloc for read buffer" has been added to the 6.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mei: use kvmalloc for read buffer

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mei-use-kvmalloc-for-read-buffer.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2d23e9505edce6c98d763ca56fa41049743e5a0f
Author: Alexander Usyskin <alexander.usyskin@xxxxxxxxx>
Date:   Tue Oct 15 15:31:57 2024 +0300

    mei: use kvmalloc for read buffer
    
    [ Upstream commit 4adf613e01bf99e1739f6ff3e162ad5b7d578d1a ]
    
    Read buffer is allocated according to max message size, reported by
    the firmware and may reach 64K in systems with pxp client.
    Contiguous 64k allocation may fail under memory pressure.
    Read buffer is used as in-driver message storage and not required
    to be contiguous.
    Use kvmalloc to allow kernel to allocate non-contiguous memory.
    
    Fixes: 3030dc056459 ("mei: add wrapper for queuing control commands.")
    Cc: stable <stable@xxxxxxxxxx>
    Reported-by: Rohit Agarwal <rohiagar@xxxxxxxxxxxx>
    Closes: https://lore.kernel.org/all/20240813084542.2921300-1-rohiagar@xxxxxxxxxxxx/
    Tested-by: Brian Geffon <bgeffon@xxxxxxxxxx>
    Signed-off-by: Alexander Usyskin <alexander.usyskin@xxxxxxxxx>
    Acked-by: Tomas Winkler <tomasw@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20241015123157.2337026-1-alexander.usyskin@xxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 9d090fa07516f..be011cef12e5d 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -321,7 +321,7 @@ void mei_io_cb_free(struct mei_cl_cb *cb)
 		return;
 
 	list_del(&cb->list);
-	kfree(cb->buf.data);
+	kvfree(cb->buf.data);
 	kfree(cb->ext_hdr);
 	kfree(cb);
 }
@@ -497,7 +497,7 @@ struct mei_cl_cb *mei_cl_alloc_cb(struct mei_cl *cl, size_t length,
 	if (length == 0)
 		return cb;
 
-	cb->buf.data = kmalloc(roundup(length, MEI_SLOT_SIZE), GFP_KERNEL);
+	cb->buf.data = kvmalloc(roundup(length, MEI_SLOT_SIZE), GFP_KERNEL);
 	if (!cb->buf.data) {
 		mei_io_cb_free(cb);
 		return NULL;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux