Skip to content

Commit

Permalink
net: kcm: fix direct access to bv_len
Browse files Browse the repository at this point in the history
Minor fix for kcm: code wanting to access the fields inside an skb
frag should use the skb_frag_*() helpers, instead of accessing the
fields directly.

Signed-off-by: Mina Almasry <almasrymina@google.com>
Link: https://lore.kernel.org/r/20240102205959.794513-1-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Mina Almasry authored and Jakub Kicinski committed Jan 4, 2024
1 parent 06d9b44 commit b15a4cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/kcm/kcmsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ static int kcm_write_msgs(struct kcm_sock *kcm)

msize = 0;
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
msize += skb_shinfo(skb)->frags[i].bv_len;
msize += skb_frag_size(&skb_shinfo(skb)->frags[i]);

iov_iter_bvec(&msg.msg_iter, ITER_SOURCE,
skb_shinfo(skb)->frags, skb_shinfo(skb)->nr_frags,
Expand Down

0 comments on commit b15a4cf

Please sign in to comment.