Messages in this thread Patch in this message | | | Date | Mon, 3 Dec 2012 08:41:16 +0100 | From | "Hans J. Koch" <> | Subject | [PATCH] stable: uio: Fix warning: 'ret' might be used uninitialized |
| |
In two cases, the return value variable "ret" can be undefined.
Signed-off-by: Hans J. Koch <hjk@hansjkoch.de> Reported-by: Vitalii Demianets <vitas@nppfactor.kiev.ua>
--- drivers/uio/uio.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 5110f36..0c80df2 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -273,6 +273,7 @@ static int uio_dev_add_attributes(struct uio_device *idev) struct uio_portio *portio; for (mi = 0; mi < MAX_UIO_MAPS; mi++) { + ret = -ENOMEM; mem = &idev->info->mem[mi]; if (mem->size == 0) break; @@ -298,6 +299,7 @@ static int uio_dev_add_attributes(struct uio_device *idev) } for (pi = 0; pi < MAX_UIO_PORT_REGIONS; pi++) { + ret = -ENOMEM; port = &idev->info->port[pi]; if (port->size == 0) break; -- 1.7.9
| |