* [PATCH] bnep: Fix using uninitialized variable
@ 2015-05-29 8:14 Andrei Emeltchenko
2015-05-29 9:11 ` Szymon Janc
0 siblings, 1 reply; 2+ messages in thread
From: Andrei Emeltchenko @ 2015-05-29 8:14 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
profiles/network/bnep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
index 59599e4..8748d68 100644
--- a/profiles/network/bnep.c
+++ b/profiles/network/bnep.c
@@ -606,8 +606,8 @@ static int bnep_server_add_legacy(int sk, uint16_t dst, char *bridge,
char *iface, const bdaddr_t *addr,
uint8_t *setup_data, int len)
{
+ uint16_t rsp = BNEP_SUCCESS;
int err, n;
- uint16_t rsp;
n = read(sk, setup_data, len);
if (n != len) {
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bnep: Fix using uninitialized variable
2015-05-29 8:14 [PATCH] bnep: Fix using uninitialized variable Andrei Emeltchenko
@ 2015-05-29 9:11 ` Szymon Janc
0 siblings, 0 replies; 2+ messages in thread
From: Szymon Janc @ 2015-05-29 9:11 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth
Hi Andrei,
On Friday 29 of May 2015 11:14:30 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> ---
> profiles/network/bnep.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
> index 59599e4..8748d68 100644
> --- a/profiles/network/bnep.c
> +++ b/profiles/network/bnep.c
> @@ -606,8 +606,8 @@ static int bnep_server_add_legacy(int sk, uint16_t dst,
> char *bridge, char *iface, const bdaddr_t *addr,
> uint8_t *setup_data, int len)
> {
> + uint16_t rsp = BNEP_SUCCESS;
> int err, n;
> - uint16_t rsp;
>
> n = read(sk, setup_data, len);
> if (n != len) {
I'd prefer if this would be set only on success path ie. right before reply
label.
--
BR
Szymon Janc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-29 9:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29 8:14 [PATCH] bnep: Fix using uninitialized variable Andrei Emeltchenko
2015-05-29 9:11 ` Szymon Janc
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).