lkml.org 
[lkml]   [2020]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: handle the return value of pskb_carve_frag_list() correctly
From
From: Miaohe Lin <linmiaohe@huawei.com>
Date: Sat, 15 Aug 2020 04:46:41 -0400

> + /* split line is in frag list */
> + if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) {
> + /* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. */
> + if (skb_has_frag_list(skb))
> + kfree_skb_list(skb_shinfo(skb)->frag_list);
> + kfree(data);
> + return -ENOMEM;

On error, the caller is going to kfree_skb(skb) which will take care of the
frag list.

\
 
 \ /
  Last update: 2020-08-17 01:01    [W:0.042 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site