From: Bharath SM <bharathsm.hsk@gmail.com>
To: marcel@holtmann.org, johan.hedberg@gmail.com,
luiz.von.dentz@intel.com, linux-bluetooth@vger.kernel.org
Cc: Bharath SM <bharathsm@microsoft.com>
Subject: [PATCH] Bluetooth: Fix unused value warning in sco_sock_connect
Date: Sat, 23 Mar 2024 12:52:53 +0530 [thread overview]
Message-ID: <20240323072253.40816-1-bharathsm@microsoft.com> (raw)
Coverity complains of an unused value:
CID 1528147: (#1 of 1): Unused value (UNUSED_VALUE)
assigned_value: Assigning value -22 to err here, but that stored
value is overwritten before it can be used.
err = -EINVAL;
Fix it by removing the assignment.
Signed-off-by: Bharath SM <bharathsm@microsoft.com>
---
net/bluetooth/sco.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 43daf965a01e..e74bce4e1d6c 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -581,9 +581,6 @@ static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen
if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND)
return -EBADFD;
- if (sk->sk_type != SOCK_SEQPACKET)
- err = -EINVAL;
-
lock_sock(sk);
/* Set destination address and psm */
bacpy(&sco_pi(sk)->dst, &sa->sco_bdaddr);
--
2.34.1
next reply other threads:[~2024-03-23 7:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-23 7:22 Bharath SM [this message]
2024-03-23 7:57 ` Bluetooth: Fix unused value warning in sco_sock_connect bluez.test.bot
2024-03-23 9:51 ` [PATCH] " Pauli Virtanen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240323072253.40816-1-bharathsm@microsoft.com \
--to=bharathsm.hsk@gmail.com \
--cc=bharathsm@microsoft.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.von.dentz@intel.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox