summaryrefslogtreecommitdiff
path: root/net/bluetooth/smp.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-06-16 19:25:14 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 17:42:42 +0200
commitc29d2444170a4e0709331e357a2738a02666a633 (patch)
treebacd0f2c19ec66de5fb1ed868957a3b8a54ff180 /net/bluetooth/smp.c
parent65cc2b49db63adf1455a9783234383fbec5b8314 (diff)
Bluetooth: Fix missing NULL check for smp_chan_create() return value
The smp_chan_create function may return NULL, e.g. in the case of memory allocation failure, so we always need to check for this. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r--net/bluetooth/smp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index e33a982161c1..1f4ed1e78e10 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -888,6 +888,8 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
return 0;
smp = smp_chan_create(conn);
+ if (!smp)
+ return SMP_UNSPECIFIED;
skb_pull(skb, sizeof(*rp));