All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] shared/shell: add return value check of io_get_fd() to input_read()
@ 2024-07-02 14:03 Roman Smirnov
  2024-07-02 15:40 ` [BlueZ,v1] " bluez.test.bot
  2024-07-03 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Roman Smirnov @ 2024-07-02 14:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Roman Smirnov

It is necessary to add a return value check.

Found with the SVACE static analysis tool.
---
 src/shared/shell.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 2ecc41bf3..add4fa131 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -289,6 +289,11 @@ static bool input_read(struct io *io, void *user_data)
 
 	fd = io_get_fd(io);
 
+	if (fd < 0) {
+		printf("io_get_fd() returned %d\n", fd);
+		return false;
+	}
+
 	if (fd == STDIN_FILENO) {
 		rl_callback_read_char();
 		return true;
-- 
2.34.1


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

* RE: [BlueZ,v1] shared/shell: add return value check of io_get_fd() to input_read()
  2024-07-02 14:03 [PATCH BlueZ v1] shared/shell: add return value check of io_get_fd() to input_read() Roman Smirnov
@ 2024-07-02 15:40 ` bluez.test.bot
  2024-07-03 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-07-02 15:40 UTC (permalink / raw)
  To: linux-bluetooth, r.smirnov

[-- Attachment #1: Type: text/plain, Size: 1317 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=867571

---Test result---

Test Summary:
CheckPatch                    PASS      0.26 seconds
GitLint                       PASS      0.19 seconds
BuildEll                      PASS      24.82 seconds
BluezMake                     PASS      1728.14 seconds
MakeCheck                     PASS      13.76 seconds
MakeDistcheck                 PASS      177.84 seconds
CheckValgrind                 PASS      252.10 seconds
CheckSmatch                   WARNING   358.33 seconds
bluezmakeextell               PASS      119.41 seconds
IncrementalBuild              PASS      1461.06 seconds
ScanBuild                     PASS      1001.32 seconds

Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):


---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v1] shared/shell: add return value check of io_get_fd() to input_read()
  2024-07-02 14:03 [PATCH BlueZ v1] shared/shell: add return value check of io_get_fd() to input_read() Roman Smirnov
  2024-07-02 15:40 ` [BlueZ,v1] " bluez.test.bot
@ 2024-07-03 15:10 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2024-07-03 15:10 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 17:03:13 +0300 you wrote:
> It is necessary to add a return value check.
> 
> Found with the SVACE static analysis tool.
> ---
>  src/shared/shell.c | 5 +++++
>  1 file changed, 5 insertions(+)

Here is the summary with links:
  - [BlueZ,v1] shared/shell: add return value check of io_get_fd() to input_read()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ee46e92bdef4

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-03 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 14:03 [PATCH BlueZ v1] shared/shell: add return value check of io_get_fd() to input_read() Roman Smirnov
2024-07-02 15:40 ` [BlueZ,v1] " bluez.test.bot
2024-07-03 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.