[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220727161015.745281832@linuxfoundation.org>
Date: Wed, 27 Jul 2022 18:11:17 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Dan Carpenter <dan.carpenter@...cle.com>,
Tedd Ho-Jeong An <tedd.an@...el.com>,
Luiz Augusto von Dentz <luiz.von.dentz@...el.com>,
Marcel Holtmann <marcel@...tmann.org>,
Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
Subject: [PATCH 5.10 091/105] Bluetooth: Fix passing NULL to PTR_ERR
From: Luiz Augusto von Dentz <luiz.von.dentz@...el.com>
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@...cle.com>
Tested-by: Tedd Ho-Jeong An <tedd.an@...el.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@...el.com>
Signed-off-by: Marcel Holtmann <marcel@...tmann.org>
Cc: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
include/net/bluetooth/bluetooth.h | 2 +-
net/bluetooth/rfcomm/sock.c | 2 +-
net/bluetooth/sco.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -474,7 +474,7 @@ static inline struct sk_buff *bt_skb_sen
struct sk_buff *tmp;
tmp = bt_skb_sendmsg(sk, msg, len, mtu, headroom, tailroom);
- if (IS_ERR_OR_NULL(tmp)) {
+ if (IS_ERR(tmp)) {
kfree_skb(skb);
return tmp;
}
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -583,7 +583,7 @@ static int rfcomm_sock_sendmsg(struct so
skb = bt_skb_sendmmsg(sk, msg, len, d->mtu, RFCOMM_SKB_HEAD_RESERVE,
RFCOMM_SKB_TAIL_RESERVE);
- if (IS_ERR_OR_NULL(skb))
+ if (IS_ERR(skb))
return PTR_ERR(skb);
sent = rfcomm_dlc_send(d, skb);
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -732,7 +732,7 @@ static int sco_sock_sendmsg(struct socke
return -EOPNOTSUPP;
skb = bt_skb_sendmsg(sk, msg, len, len, 0, 0);
- if (IS_ERR_OR_NULL(skb))
+ if (IS_ERR(skb))
return PTR_ERR(skb);
lock_sock(sk);
Powered by blists - more mailing lists