summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-04-21 12:49:37 +0200
committerDavid S. Miller <davem@davemloft.net>2017-04-24 18:38:03 +0200
commit11faa7b0359aaf7efd406b7a6a077fda2b037d8e (patch)
tree2fc20f5dad734fd57c99220811882b48741ed824 /drivers
parentnet/mlx5e: Fix race in mlx5e_sw_stats and mlx5e_vport_stats (diff)
downloadlinux-11faa7b0359aaf7efd406b7a6a077fda2b037d8e.tar.xz
linux-11faa7b0359aaf7efd406b7a6a077fda2b037d8e.zip
net: tc35815: move free after the dereference
We dereference "skb" to get "skb->len" so we should probably do that step before freeing the skb. Fixes: eea221ce4880 ("tc35815 driver update (take 2)") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/toshiba/tc35815.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c
index a45f98fa4aa7..3dadee1080b9 100644
--- a/drivers/net/ethernet/toshiba/tc35815.c
+++ b/drivers/net/ethernet/toshiba/tc35815.c
@@ -1017,8 +1017,8 @@ tc35815_free_queues(struct net_device *dev)
BUG_ON(lp->tx_skbs[i].skb != skb);
#endif
if (skb) {
- dev_kfree_skb(skb);
pci_unmap_single(lp->pci_dev, lp->tx_skbs[i].skb_dma, skb->len, PCI_DMA_TODEVICE);
+ dev_kfree_skb(skb);
lp->tx_skbs[i].skb = NULL;
lp->tx_skbs[i].skb_dma = 0;
}