Message ID | 20230202-rds-zerocopy-v3-1-83b0df974f9a@diag.uniroma1.it (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | [net,v3] rds: rds_rm_zerocopy_callback() use list_first_entry() | expand |
Hello: This patch was applied to netdev/net.git (master) by Paolo Abeni <pabeni@redhat.com>: On Tue, 07 Feb 2023 18:26:34 +0000 you wrote: > 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@google.com> > Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it> > > [...] Here is the summary with links: - [net,v3] rds: rds_rm_zerocopy_callback() use list_first_entry() https://git.kernel.org/netdev/net/c/f753a68980cf You are awesome, thank you!
diff --git a/net/rds/message.c b/net/rds/message.c index b47e4f0a1639..c19c93561227 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() */