staging: wlags49_h2: Fix use of skb after netif_rx
authorHimangi Saraogi <himangi774@gmail.com>
Sat, 21 Jun 2014 15:04:09 +0000 (20:34 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2014 00:18:58 +0000 (20:18 -0400)
commit31cd921dea3274202399078443dc6e93ca3f84c1
tree70dd0ba8a6b94366f0345e2d0b470014274cd8b6
parent7873311aed5436bad100ff7ed98f159e6c8c17a7
staging: wlags49_h2: Fix use of skb after netif_rx

This patch moves a call to netif_rx(skb) after a subsequent reference to
skb, because netif_rx may call kfree_skb via enqueue_to_backlog on its
argument.

This was found using the following semantic match.

// <smpl>
@@
expression skb, e,e1;
@@

(
 netif_rx(skb);
|
 netif_rx_ni(skb);
)
  ... when != skb = e
(
  skb = e1
|
* skb
)
// </smpl>

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlags49_h2/wl_netdev.c