diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-03-16 00:53:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-16 17:15:41 -0400 |
commit | edee39321be9f88c47627379e8abadfce0508768 (patch) | |
tree | 455df0017e6d6be1d16ccb415fc0205097953e04 /drivers | |
parent | 6ad34145cf809384359fe513481d6e16638a57a3 (diff) |
NET: ksz884x, fix lock imbalance
Stanse found that one error path (when alloc_skb fails) in netdev_tx
omits to unlock hw_priv->hwlock. Fix that.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Tristram Ha <Tristram.Ha@micrel.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ksz884x.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c index 7264a3e5c2c0..0f59099ee72f 100644 --- a/drivers/net/ksz884x.c +++ b/drivers/net/ksz884x.c | |||
@@ -4899,8 +4899,10 @@ static int netdev_tx(struct sk_buff *skb, struct net_device *dev) | |||
4899 | struct sk_buff *org_skb = skb; | 4899 | struct sk_buff *org_skb = skb; |
4900 | 4900 | ||
4901 | skb = dev_alloc_skb(org_skb->len); | 4901 | skb = dev_alloc_skb(org_skb->len); |
4902 | if (!skb) | 4902 | if (!skb) { |
4903 | return NETDEV_TX_BUSY; | 4903 | rc = NETDEV_TX_BUSY; |
4904 | goto unlock; | ||
4905 | } | ||
4904 | skb_copy_and_csum_dev(org_skb, skb->data); | 4906 | skb_copy_and_csum_dev(org_skb, skb->data); |
4905 | org_skb->ip_summed = 0; | 4907 | org_skb->ip_summed = 0; |
4906 | skb->len = org_skb->len; | 4908 | skb->len = org_skb->len; |
@@ -4914,7 +4916,7 @@ static int netdev_tx(struct sk_buff *skb, struct net_device *dev) | |||
4914 | netif_stop_queue(dev); | 4916 | netif_stop_queue(dev); |
4915 | rc = NETDEV_TX_BUSY; | 4917 | rc = NETDEV_TX_BUSY; |
4916 | } | 4918 | } |
4917 | 4919 | unlock: | |
4918 | spin_unlock_irq(&hw_priv->hwlock); | 4920 | spin_unlock_irq(&hw_priv->hwlock); |
4919 | 4921 | ||
4920 | return rc; | 4922 | return rc; |