]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Bluetooth: Fix missing NULL check for smp_chan_create() return value
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 16 Jun 2014 16:25:14 +0000 (19:25 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 3 Jul 2014 15:42:42 +0000 (17:42 +0200)
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>
net/bluetooth/smp.c

index e33a982161c1db063b5cb96f06a10babb5f0b436..1f4ed1e78e10cb11a8bcfb98a78acf1216d5d73d 100644 (file)
@@ -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));