lkml.org 
[lkml]   [2019]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tools: ffs-aio-example: fix uninitialized boolean variable 'ready'
Date
From: Colin Ian King <colin.king@canonical.com>

The boolean variable is uninitialized and is only set if file
descriptor ep0 is ready. Fix this by ensuring the variable is
initialized by setting it to false.

Fixes: b34e08d5c706 ("tools: usb: aio example applications")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c b/tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c
index aaca1f44e788..1dda6e816b3c 100644
--- a/tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c
+++ b/tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c
@@ -246,7 +246,7 @@ int main(int argc, char *argv[])

struct io_buffer iobuf[2];
int actual = 0;
- bool ready;
+ bool ready = false;

if (argc != 2) {
printf("ffs directory not specified!\n");
--
2.20.1
\
 
 \ /
  Last update: 2019-02-11 14:49    [W:0.020 / U:17.132 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site