Patch "rds: rds_rm_zerocopy_callback() use list_first_entry()" has been added to the 5.4-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

    rds: rds_rm_zerocopy_callback() use list_first_entry()

to the 5.4-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:
     rds-rds_rm_zerocopy_callback-use-list_first_entry.patch
and it can be found in the queue-5.4 subdirectory.

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



commit e0d30089a78f20d41db70fd4219b2bd061774d35
Author: Pietro Borrello <borrello@xxxxxxxxxxxxxxxx>
Date:   Tue Feb 7 18:26:34 2023 +0000

    rds: rds_rm_zerocopy_callback() use list_first_entry()
    
    [ Upstream commit f753a68980cf4b59a80fe677619da2b1804f526d ]
    
    rds_rm_zerocopy_callback() uses list_entry() on the head of a list
    causing a type confusion.
    Use list_first_entry() to actually access the first element of the
    rs_zcookie_queue list.
    
    Fixes: 9426bbc6de99 ("rds: use list structure to track information for zerocopy completion notification")
    Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>
    Signed-off-by: Pietro Borrello <borrello@xxxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230202-rds-zerocopy-v3-1-83b0df974f9a@xxxxxxxxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/rds/message.c b/net/rds/message.c
index 92b6b22884d4c..be6a0a073b12a 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -104,9 +104,9 @@ static void rds_rm_zerocopy_callback(struct rds_sock *rs,
 	spin_lock_irqsave(&q->lock, flags);
 	head = &q->zcookie_head;
 	if (!list_empty(head)) {
-		info = list_entry(head, struct rds_msg_zcopy_info,
-				  rs_zcookie_next);
-		if (info && rds_zcookie_add(info, cookie)) {
+		info = list_first_entry(head, struct rds_msg_zcopy_info,
+					rs_zcookie_next);
+		if (rds_zcookie_add(info, cookie)) {
 			spin_unlock_irqrestore(&q->lock, flags);
 			kfree(rds_info_from_znotifier(znotif));
 			/* caller invokes rds_wake_sk_sleep() */



[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