linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] client/player: add return value check of io_get_fd() to transport_recv()
@ 2024-07-02 11:51 Roman Smirnov
  2024-07-02 13:54 ` [BlueZ,v1] " bluez.test.bot
  2024-07-10 14:30 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Roman Smirnov @ 2024-07-02 11:51 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Roman Smirnov

It is necessary to add return value check as in sock_send().

Found with the SVACE static analysis tool.
---
 client/player.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/client/player.c b/client/player.c
index 7a7598c39..b1ebcaa37 100644
--- a/client/player.c
+++ b/client/player.c
@@ -4514,7 +4514,13 @@ static bool transport_recv(struct io *io, void *user_data)
 	uint8_t buf[1024];
 	int ret, len;
 
-	ret = read(io_get_fd(io), buf, sizeof(buf));
+	ret = io_get_fd(io);
+	if (ret < 0) {
+		bt_shell_printf("io_get_fd() returned %d\n", ret);
+		return true;
+	}
+
+	ret = read(ret, buf, sizeof(buf));
 	if (ret < 0) {
 		bt_shell_printf("Failed to read: %s (%d)\n", strerror(errno),
 								-errno);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [BlueZ,v1] client/player: add return value check of io_get_fd() to transport_recv()
  2024-07-02 11:51 [PATCH BlueZ v1] client/player: add return value check of io_get_fd() to transport_recv() Roman Smirnov
@ 2024-07-02 13:54 ` bluez.test.bot
  2024-07-10 14:30 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-07-02 13:54 UTC (permalink / raw)
  To: linux-bluetooth, r.smirnov

[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=867513

---Test result---

Test Summary:
CheckPatch                    PASS      10.17 seconds
GitLint                       FAIL      2.19 seconds
BuildEll                      PASS      24.83 seconds
BluezMake                     PASS      1732.88 seconds
MakeCheck                     PASS      13.23 seconds
MakeDistcheck                 PASS      178.96 seconds
CheckValgrind                 PASS      254.56 seconds
CheckSmatch                   PASS      361.49 seconds
bluezmakeextell               PASS      121.59 seconds
IncrementalBuild              PASS      1498.74 seconds
ScanBuild                     PASS      1034.92 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,v1] client/player: add return value check of io_get_fd() to transport_recv()

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
1: T1 Title exceeds max length (83>80): "[BlueZ,v1] client/player: add return value check of io_get_fd() to transport_recv()"


---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ v1] client/player: add return value check of io_get_fd() to transport_recv()
  2024-07-02 11:51 [PATCH BlueZ v1] client/player: add return value check of io_get_fd() to transport_recv() Roman Smirnov
  2024-07-02 13:54 ` [BlueZ,v1] " bluez.test.bot
@ 2024-07-10 14:30 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2024-07-10 14:30 UTC (permalink / raw)
  To: Roman Smirnov; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue, 2 Jul 2024 14:51:38 +0300 you wrote:
> It is necessary to add return value check as in sock_send().
> 
> Found with the SVACE static analysis tool.
> ---
>  client/player.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,v1] client/player: add return value check of io_get_fd() to transport_recv()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=12525371ef08

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-10 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 11:51 [PATCH BlueZ v1] client/player: add return value check of io_get_fd() to transport_recv() Roman Smirnov
2024-07-02 13:54 ` [BlueZ,v1] " bluez.test.bot
2024-07-10 14:30 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).