macvtap: switch to use skb array
Hello Jason Wang,
The patch 362899b8725b: "macvtap: switch to use skb array" from Jul 15, 2016, leads to the following static checker warning:
drivers/net/macvtap.c:539 macvtap_sock_destruct()
error: use kfree_skb() here instead of kfree(skb)
drivers/net/macvtap.c
533 static void macvtap_sock_destruct(struct sock *sk) 534 {
535 struct macvtap_queue *q = container_of(sk, struct macvtap_queue, sk);
536 struct sk_buff *skb;
537
538 while ((skb = skb_array_consume(&q->skb_array)) != NULL)
539 kfree(skb);
Should be kfree_skb(). On my way to airport or would send patch.
540 }
regards,
dan carpenter
Quoted 17 lines · Dan Carpenter
Hello Jason Wang,
The patch
362899b8725b: "macvtap: switch to use skb array" from Jul 15, 2016, leads to the following static checker warning:
drivers/net/macvtap.c:539macvtap_sock_destruct()
error: usekfree_skb()here instead of kfree(skb)
drivers/net/macvtap.c533 static void macvtap_sock_destruct(struct sock *sk) 534 { 535 struct macvtap_queue *q = container_of(sk, struct macvtap_queue, sk); 536 struct sk_buff *skb; 537 538 while ((skb = skb_array_consume(&q->skb_array)) != NULL) 539 kfree(skb);
Quoted 1 line
Should be
kfree_skb(). On my way to airport or would send patch.
Patch sent, thanks a lot!
Quoted 5 lines
540 }regards,
dan carpenter