[PATCH] stable: uio: Fix warning: 'ret' might be used uninitialized
From: Hans J. Koch
Date: Mon Dec 03 2012 - 02:41:14 EST
In two cases, the return value variable "ret" can be undefined.
Signed-off-by: Hans J. Koch <hjk@xxxxxxxxxxxx>
Reported-by: Vitalii Demianets <vitas@xxxxxxxxxxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/