Bluetooth: Fix potential NULL dereference
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 3 Feb 2015 08:01:13 +0000 (10:01 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 3 Feb 2015 08:02:12 +0000 (09:02 +0100)
commit88d9077c27d0c1a7c022d9dc987640beecf23560
tree0e72093db43abd243deaf2bdaf054262e7694feb
parent8f0c304c693c5a9759ed6ae50d07d4590dad5ae7
Bluetooth: Fix potential NULL dereference

The bnep_get_device function may be triggered by an ioctl just after a
connection has gone down. In such a case the respective L2CAP chan->conn
pointer will get set to NULL (by l2cap_chan_del). This patch adds a
missing NULL check for this case in the bnep_get_device() function.

Reported-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/bnep/core.c