[PATCH] uio: Fix warning: 'ret' might be used uninitialized

From: Hans J. Koch
Date: Tue Nov 27 2012 - 17:38:00 EST


In two cases, the return value variable "ret" can be undefined.

Signed-off-by: Hans J. Koch <hjk@xxxxxxxxxxxx>
---
drivers/uio/uio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 5110f36..fc60e35 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -263,7 +263,7 @@ static struct class uio_class = {
*/
static int uio_dev_add_attributes(struct uio_device *idev)
{
- int ret;
+ int ret = -ENOMEM;
int mi, pi;
int map_found = 0;
int portio_found = 0;
--
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/