diff mbox series

[BlueZ,v1] shared/shell: add return value check of io_get_fd() to input_read()

Message ID 20240702140313.107131-1-r.smirnov@omp.ru (mailing list archive)
State Accepted
Commit ee46e92bdef44e85cf4d6b10e08d56a2aa7706be
Headers show
Series [BlueZ,v1] shared/shell: add return value check of io_get_fd() to input_read() | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch warning CheckSparse WARNING 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):
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Roman Smirnov July 2, 2024, 2:03 p.m. UTC
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(+)

Comments

bluez.test.bot@gmail.com July 2, 2024, 3:40 p.m. UTC | #1
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
patchwork-bot+bluetooth@kernel.org July 3, 2024, 3:10 p.m. UTC | #2
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!
diff mbox series

Patch

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;