Skip to content

Commit f753a68

Browse files
pietroborrelloPaolo Abeni
authored andcommitted
rds: rds_rm_zerocopy_callback() use list_first_entry()
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: 9426bbc ("rds: use list structure to track information for zerocopy completion notification") Reviewed-by: Willem de Bruijn <[email protected]> Signed-off-by: Pietro Borrello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 646be03 commit f753a68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/rds/message.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ static void rds_rm_zerocopy_callback(struct rds_sock *rs,
104104
spin_lock_irqsave(&q->lock, flags);
105105
head = &q->zcookie_head;
106106
if (!list_empty(head)) {
107-
info = list_entry(head, struct rds_msg_zcopy_info,
108-
rs_zcookie_next);
109-
if (info && rds_zcookie_add(info, cookie)) {
107+
info = list_first_entry(head, struct rds_msg_zcopy_info,
108+
rs_zcookie_next);
109+
if (rds_zcookie_add(info, cookie)) {
110110
spin_unlock_irqrestore(&q->lock, flags);
111111
kfree(rds_info_from_znotifier(znotif));
112112
/* caller invokes rds_wake_sk_sleep() */

0 commit comments

Comments
 (0)