From: Himangi Saraogi Date: Sat, 21 Jun 2014 15:04:09 +0000 (+0530) Subject: staging: wlags49_h2: Fix use of skb after netif_rx X-Git-Tag: v3.17-rc1~123^2~1495 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31cd921dea3274202399078443dc6e93ca3f84c1;p=platform%2Fkernel%2Flinux-exynos.git 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. // @@ expression skb, e,e1; @@ ( netif_rx(skb); | netif_rx_ni(skb); ) ... when != skb = e ( skb = e1 | * skb ) // Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c index a10d014..60701d43 100644 --- a/drivers/staging/wlags49_h2/wl_netdev.c +++ b/drivers/staging/wlags49_h2/wl_netdev.c @@ -888,8 +888,6 @@ int wl_rx(struct net_device *dev) GET_PACKET(skb->dev, skb, pktlen); if (status == HCF_SUCCESS) { - netif_rx(skb); - if (port == 0) { lp->stats.rx_packets++; lp->stats.rx_bytes += pktlen; @@ -918,6 +916,7 @@ int wl_rx(struct net_device *dev) } #endif /* WIRELESS_SPY */ #endif /* WIRELESS_EXT */ + netif_rx(skb); } else { DBG_ERROR(DbgInfo, "Rx request to card FAILED\n");