From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 3 Dec 2012 08:41:16 +0100 From: "Hans J. Koch" To: Greg Kroah-Hartman Cc: "Hans J. Koch" , Vitalii Demianets , Tux9 , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] stable: uio: Fix warning: 'ret' might be used uninitialized Message-ID: <20121203074116.GB7723@local> References: <201211271348.14603.vitas@nppfactor.kiev.ua> <201211291836.59358.vitas@nppfactor.kiev.ua> <20121129235822.GA2590@local> <201211301316.19217.vitas@nppfactor.kiev.ua> <20121130213906.GB2603@local> <20121130234331.GD17353@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121130234331.GD17353@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: In two cases, the return value variable "ret" can be undefined. Signed-off-by: Hans J. Koch Reported-by: Vitalii Demianets --- 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