mac802154: llsec: fix incorrect lock pairing
authorPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Tue, 20 May 2014 11:14:22 +0000 (13:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 May 2014 19:24:13 +0000 (15:24 -0400)
In encrypt, sec->lock is taken with read_lock_bh, so in the error path,
we must read_unlock_bh.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mac802154/llsec.c

index a83674e..6edcb20 100644 (file)
@@ -776,7 +776,7 @@ int mac802154_llsec_encrypt(struct mac802154_llsec *sec, struct sk_buff *skb)
        return rc < 0 ? rc : 0;
 
 fail_read:
-       read_unlock(&sec->lock);
+       read_unlock_bh(&sec->lock);
 fail:
        rcu_read_unlock();
        return rc;