Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: "Hans J. Koch" <hjk@hansjkoch.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>,
	Vitalii Demianets <vitas@nppfactor.kiev.ua>,
	Tux9 <tuxding@gmail.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH] stable: uio: Fix warning: 'ret' might be used uninitialized
Date: Mon, 3 Dec 2012 08:41:16 +0100	[thread overview]
Message-ID: <20121203074116.GB7723@local> (raw)
In-Reply-To: <20121130234331.GD17353@kroah.com>

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


       reply	other threads:[~2012-12-03  7:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201211271348.14603.vitas@nppfactor.kiev.ua>
     [not found] ` <201211291836.59358.vitas@nppfactor.kiev.ua>
     [not found]   ` <20121129235822.GA2590@local>
     [not found]     ` <201211301316.19217.vitas@nppfactor.kiev.ua>
     [not found]       ` <20121130213906.GB2603@local>
     [not found]         ` <20121130234331.GD17353@kroah.com>
2012-12-03  7:41           ` Hans J. Koch [this message]
2012-12-03 13:38             ` [PATCH] stable: uio: Fix warning: 'ret' might be used uninitialized Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121203074116.GB7723@local \
    --to=hjk@hansjkoch.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tuxding@gmail.com \
    --cc=vitas@nppfactor.kiev.ua \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox