Bluetooth: Fix potential NULL dereference in RFCOMM bind callback
authorJaganath Kanakkassery <jaganath.k@samsung.com>
Thu, 14 May 2015 07:28:08 +0000 (12:58 +0530)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 Nov 2016 01:01:43 +0000 (01:01 +0000)
commit4ccd61d9e112c13be97d614883a5ddc426233b7f
tree5f9f0bc0d81dbfa8fbcbe9a9b90c73aa2889dd1c
parente22b0efe1f8f2b84371c8288a5179d3489f406b5
Bluetooth: Fix potential NULL dereference in RFCOMM bind callback

commit 951b6a0717db97ce420547222647bcc40bf1eacd upstream.

addr can be NULL and it should not be dereferenced before NULL checking.

Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
[bwh: Backported to 3.2:
 - There's no 'chan' variable
 - Keep using batostr() to log addresses
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/bluetooth/rfcomm/sock.c