diff mbox series

[wpan-tools] hwsim: make sure lqi is always initialized

Message ID 20181129195800.28483-1-stefan@datenfreihafen.org (mailing list archive)
State Accepted
Headers show
Series [wpan-tools] hwsim: make sure lqi is always initialized | expand

Commit Message

Stefan Schmidt Nov. 29, 2018, 7:58 p.m. UTC
The lqi variable was not initialized in all code paths.

CID: 185497

Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
---
 wpan-hwsim/wpan-hwsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Schmidt Dec. 6, 2018, 7:34 p.m. UTC | #1
Hello.

On 29.11.18 20:58, Stefan Schmidt wrote:
> The lqi variable was not initialized in all code paths.
> 
> CID: 185497
> 
> Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
> ---
>  wpan-hwsim/wpan-hwsim.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/wpan-hwsim/wpan-hwsim.c b/wpan-hwsim/wpan-hwsim.c
> index 3e54348..0a7c492 100644
> --- a/wpan-hwsim/wpan-hwsim.c
> +++ b/wpan-hwsim/wpan-hwsim.c
> @@ -382,7 +382,7 @@ static void print_version(void)
>  
>  int main(int argc, const char *argv[])
>  {
> -	unsigned long int idx, idx2, lqi, ignore_idx = ULONG_MAX;
> +	unsigned long int idx, idx2, lqi = 0, ignore_idx = ULONG_MAX;
>  	bool dot = false;
>  	int cmd;
>  	int rc;
> 

No complains and trivial enough. Applied to wpan-tools master.

regards
Stefan Schmidt
diff mbox series

Patch

diff --git a/wpan-hwsim/wpan-hwsim.c b/wpan-hwsim/wpan-hwsim.c
index 3e54348..0a7c492 100644
--- a/wpan-hwsim/wpan-hwsim.c
+++ b/wpan-hwsim/wpan-hwsim.c
@@ -382,7 +382,7 @@  static void print_version(void)
 
 int main(int argc, const char *argv[])
 {
-	unsigned long int idx, idx2, lqi, ignore_idx = ULONG_MAX;
+	unsigned long int idx, idx2, lqi = 0, ignore_idx = ULONG_MAX;
 	bool dot = false;
 	int cmd;
 	int rc;