2014-01-09 09:26:05

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH] android/haltest: Fix double file close

From: Andrei Emeltchenko <[email protected]>

---
android/android-tester.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/android/android-tester.c b/android/android-tester.c
index a448ab5..f5f8c62 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -443,8 +443,6 @@ static void emulator(int pipe, int hci_index)
if (len <= 0 || (strcmp(buf, "ctl.start=bluetoothd")))
goto failed;

- close(pipe);
- close(fd);
bluetoothd_start(hci_index);

failed:
--
1.8.3.2



2014-01-13 17:54:00

by Anderson Lizardo

[permalink] [raw]
Subject: Re: [PATCH] android/haltest: Fix double file close

Hi Andrei,

I see that you are fixing some issues pointed by Coverity Scan. Last
month, I registered a project there for BlueZ. If you are interested
in coordinating fixes (so we don't end up working on fixing the same
issues), let know the email you registered there so I can add you as
member of the project.

The same invitation applies to any regular BlueZ developer that wants
to work on analyzing and fixing bugs reported by Coverity. You can
also request to apply on the project page:

https://scan.coverity.com/projects/1109

Best Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

2014-01-09 17:06:19

by Szymon Janc

[permalink] [raw]
Subject: Re: [PATCH] android/haltest: Silence static analyzers

Hi Andrei,

On Thursday 09 January 2014 12:45:20 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <[email protected]>
>
> This makes code more readable and silence static analyzers which think
> that pipe and fd are close two times.
> ---
> android/android-tester.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/android/android-tester.c b/android/android-tester.c
> index a448ab5..c14cc19 100644
> --- a/android/android-tester.c
> +++ b/android/android-tester.c
> @@ -445,7 +445,7 @@ static void emulator(int pipe, int hci_index)
>
> close(pipe);
> close(fd);
> - bluetoothd_start(hci_index);
> + return bluetoothd_start(hci_index);
>
> failed:
> close(pipe);

Applied, thanks.

--
Szymon K. Janc
[email protected]

2014-01-09 10:45:20

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH] android/haltest: Silence static analyzers

From: Andrei Emeltchenko <[email protected]>

This makes code more readable and silence static analyzers which think
that pipe and fd are close two times.
---
android/android-tester.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/android-tester.c b/android/android-tester.c
index a448ab5..c14cc19 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -445,7 +445,7 @@ static void emulator(int pipe, int hci_index)

close(pipe);
close(fd);
- bluetoothd_start(hci_index);
+ return bluetoothd_start(hci_index);

failed:
close(pipe);
--
1.8.3.2