Commit f753a689 authored by Pietro Borrello's avatar Pietro Borrello Committed by Paolo Abeni

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: 9426bbc6 ("rds: use list structure to track information for zerocopy completion notification")
Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarPietro Borrello <borrello@diag.uniroma1.it>
Link: https://lore.kernel.org/r/20230202-rds-zerocopy-v3-1-83b0df974f9a@diag.uniroma1.itSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 646be03e
...@@ -104,9 +104,9 @@ static void rds_rm_zerocopy_callback(struct rds_sock *rs, ...@@ -104,9 +104,9 @@ static void rds_rm_zerocopy_callback(struct rds_sock *rs,
spin_lock_irqsave(&q->lock, flags); spin_lock_irqsave(&q->lock, flags);
head = &q->zcookie_head; head = &q->zcookie_head;
if (!list_empty(head)) { if (!list_empty(head)) {
info = list_entry(head, struct rds_msg_zcopy_info, info = list_first_entry(head, struct rds_msg_zcopy_info,
rs_zcookie_next); rs_zcookie_next);
if (info && rds_zcookie_add(info, cookie)) { if (rds_zcookie_add(info, cookie)) {
spin_unlock_irqrestore(&q->lock, flags); spin_unlock_irqrestore(&q->lock, flags);
kfree(rds_info_from_znotifier(znotif)); kfree(rds_info_from_znotifier(znotif));
/* caller invokes rds_wake_sk_sleep() */ /* caller invokes rds_wake_sk_sleep() */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment