public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] firewire: fw_device_init: ‘minor’ may be used uninitialized
@ 2013-02-18 21:19 Tim Gardner
  2013-02-18 21:24 ` [PATCH linux-next v2] firewire: fw_device_init: 'minor' " Tim Gardner
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Gardner @ 2013-02-18 21:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tim Gardner, Stefan Richter, linux1394-devel

'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]

Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---

If this patch is correct, then it also ought to go to stable
if it misses 3.8 final.

 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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH linux-next v2] firewire: fw_device_init: 'minor' may be used uninitialized
  2013-02-18 21:19 [PATCH linux-next] firewire: fw_device_init: ‘minor’ may be used uninitialized Tim Gardner
@ 2013-02-18 21:24 ` Tim Gardner
  2013-02-19  9:09   ` Stefan Richter
  2013-02-19  9:15   ` Stefan Richter
  0 siblings, 2 replies; 5+ messages in thread
From: Tim Gardner @ 2013-02-18 21:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tim Gardner, Stefan Richter, linux1394-devel

'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]

Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---

If this patch is correct, then it also ought to go to stable
if it misses 3.8 final.

v2 - Better commit subject

 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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH linux-next v2] firewire: fw_device_init: 'minor' may be used uninitialized
  2013-02-18 21:24 ` [PATCH linux-next v2] firewire: fw_device_init: 'minor' " Tim Gardner
@ 2013-02-19  9:09   ` Stefan Richter
  2013-02-19 18:42     ` Tejun Heo
  2013-02-19  9:15   ` Stefan Richter
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Richter @ 2013-02-19  9:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Tim Gardner, linux-kernel, linux1394-devel, Tejun Heo

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/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next v2] firewire: fw_device_init: 'minor' may be used uninitialized
  2013-02-18 21:24 ` [PATCH linux-next v2] firewire: fw_device_init: 'minor' " Tim Gardner
  2013-02-19  9:09   ` Stefan Richter
@ 2013-02-19  9:15   ` Stefan Richter
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Richter @ 2013-02-19  9:15 UTC (permalink / raw)
  To: Tim Gardner; +Cc: linux-kernel, linux1394-devel

On Feb 18 Tim Gardner wrote:
> 'firewire: convert to idr_alloc()' accidentally orphaned 'minor'.
[...]
> If this patch is correct, then it also ought to go to stable
> if it misses 3.8 final.

"firewire: convert to idr_alloc()" is pending for merge after 3.8/
before 3.9-rc1, IOW 3.8 is not affected.  (I notified akpm who handles the
faulty patch.)
-- 
Stefan Richter
-=====-===-= --=- =--==
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next v2] firewire: fw_device_init: 'minor' may be used uninitialized
  2013-02-19  9:09   ` Stefan Richter
@ 2013-02-19 18:42     ` Tejun Heo
  0 siblings, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2013-02-19 18:42 UTC (permalink / raw)
  To: Stefan Richter; +Cc: Andrew Morton, Tim Gardner, linux-kernel, linux1394-devel

On Tue, Feb 19, 2013 at 10:09:07AM +0100, Stefan Richter wrote:
> 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>

Acked-by: Tejun Heo <tj@kernel.org>

Sorry about that. :)

-- 
tejun

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-19 18:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-02-19 18:42     ` Tejun Heo
2013-02-19  9:15   ` Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox