From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Tim Gardner <tim.gardner@canonical.com>,
linux-kernel@vger.kernel.org,
linux1394-devel@lists.sourceforge.net, Tejun Heo <tj@kernel.org>
Subject: [PATCH linux-next v2] firewire: fw_device_init: 'minor' may be used uninitialized
Date: Tue, 19 Feb 2013 10:09:07 +0100 [thread overview]
Message-ID: <20130219100907.5dff3124@stein> (raw)
In-Reply-To: <1361222676-113069-1-git-send-email-tim.gardner@canonical.com>
Date: Mon, 18 Feb 2013 14:24:36 -0700
From: Tim Gardner <tim.gardner@canonical.com>
'firewire: convert to idr_alloc()' accidentally orphaned 'minor'.
drivers/firewire/core-device.c: In function ‘fw_device_init’:
drivers/firewire/core-device.c:1029:24: warning: ‘minor’ may be used uninitialized in this function [-Wuninitialized]
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
Andrew, please send this on together with the other idr patches,
or even merge this into patch "firewire: convert to idr_alloc()" before
the latter reaches upstream.
drivers/firewire/core-device.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
index b946330..03ce7d9 100644
--- a/drivers/firewire/core-device.c
+++ b/drivers/firewire/core-device.c
@@ -1017,10 +1017,11 @@ static void fw_device_init(struct work_struct *work)
fw_device_get(device);
down_write(&fw_device_rwsem);
- ret = idr_alloc(&fw_device_idr, device, 0, 1 << MINORBITS, GFP_KERNEL);
+ minor = idr_alloc(&fw_device_idr, device, 0, 1 << MINORBITS,
+ GFP_KERNEL);
up_write(&fw_device_rwsem);
- if (ret < 0)
+ if (minor < 0)
goto error;
device->device.bus = &fw_bus_type;
--
Stefan Richter
-=====-===-= --=- =--==
http://arcgraph.de/sr/
next prev parent reply other threads:[~2013-02-19 9:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-18 21:19 [PATCH linux-next] firewire: fw_device_init: ‘minor’ may be used uninitialized Tim Gardner
2013-02-18 21:24 ` [PATCH linux-next v2] firewire: fw_device_init: 'minor' " Tim Gardner
2013-02-19 9:09 ` Stefan Richter [this message]
2013-02-19 18:42 ` Tejun Heo
2013-02-19 9:15 ` Stefan Richter
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=20130219100907.5dff3124@stein \
--to=stefanr@s5r6.in-berlin.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=tim.gardner@canonical.com \
--cc=tj@kernel.org \
/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