Bluetooth: Fix passing NULL to PTR_ERR
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 16 Sep 2021 20:10:48 +0000 (13:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:25:30 +0000 (17:25 +0200)
commit5ae749f40d0166be68d845781fe61bfcfa147ba4
tree1a546faf8ef8b52059286e93a802e0bf52ae6796
parent367becefb8a1b4512d6ec4d6dc7e84006f8ac773
Bluetooth: Fix passing NULL to PTR_ERR

commit 266191aa8d14b84958aaeb5e96ee4e97839e3d87 upstream.

Passing NULL to PTR_ERR will result in 0 (success), also since the likes of
bt_skb_sendmsg does never return NULL it is safe to replace the instances of
IS_ERR_OR_NULL with IS_ERR when checking its return.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/bluetooth/bluetooth.h
net/bluetooth/rfcomm/sock.c
net/bluetooth/sco.c