Skip to contentSkip to conversation

drivers/net/wireless: correct error-handling code

PATCH Applied Julia Lawall 7 participants 12 messages Jul 28, 2009 – Aug 11, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 5/9 drivers/net/wireless: correct error-handling code

From: Julia Lawall <[email protected]>

iwm_wdev_alloc returns an ERR_PTR value in an error case instead of NULL.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@match exists@
expression x, E;
statement S1, S2;
@@

x = iwm_wdev_alloc(...)
... when != x = E
(
* if (x = NULL || ...) S1 else S2
|
* if (x = NULL && ...) S1 else S2
)
// </smpl>

---
 drivers/net/wireless/iwmc3200wifi/netdev.c     |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/iwmc3200wifi/netdev.c +1 -1
index bb71f8a..e1c6693 100644
@@ -99,7 +99,7 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
 	int ret = 0;
 
 	wdev = iwm_wdev_alloc(sizeof_bus, dev);
-	if (!wdev) {
+	if (IS_ERR(wdev)) {
 		dev_err(dev, "no memory for wireless device instance\n");
 		return ERR_PTR(-ENOMEM);
 	}
maintainer
#1 lore raw

From: Julia Lawall <[email protected]>
Date: Tue, 28 Jul 2009 17:54:24 +0200 (CEST)

Wireless patches need to be CC:'d to linux-wireless so that John Linville can notice and pick them up. Added...

Quoted 46 lines

From: Julia Lawall <[email protected]>

iwm_wdev_alloc returns an ERR_PTR value in an error case instead of NULL.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@match exists@
expression x, E;
statement S1, S2;
@@

x = iwm_wdev_alloc(...)
... when != x = E
(
* if (x == NULL || ...) S1 else S2
|
* if (x == NULL && ...) S1 else S2
)
// </smpl>

---
 drivers/net/wireless/iwmc3200wifi/netdev.c     |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/iwmc3200wifi/netdev.c +1 -2
index bb71f8a..e1c6693 100644
@@ -99,7 +99,7 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
 	int ret = 0;
 
 	wdev = iwm_wdev_alloc(sizeof_bus, dev);
-	if (!wdev) {
+	if (IS_ERR(wdev)) {
 		dev_err(dev, "no memory for wireless device instance\n");
 		return ERR_PTR(-ENOMEM);
 	}
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 5 lines · David Miller

From: Julia Lawall <[email protected]>
Date: Tue, 28 Jul 2009 17:54:24 +0200 (CEST)

Wireless patches need to be CC:'d to linux-wireless so that John Linville can notice and pick them up. Added...

Thanks...FWIW, I've got a nearly identical patch from Dan Carpenter queued already.

John

Signature · 7 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
			¡Viva Honduras Libre!
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH 1/1 MAINTAINERS: Add networking wireless drivers section

In reply to David Miller
Quoted 2 lines · David Miller

Wireless patches need to be CC:'d to linux-wireless so that John Linville can notice and pick them up

MAINTAINERS +6 -0
index ebc2691..0574aad 100644
@@ -4186,6 +4186,12 @@ T:	git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
 S:	Odd Fixes
 F:	drivers/net/
 
+NETWORKING WIRELESS DRIVERS
+L:	[email protected]
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
+S:	Odd Fixes
+F:	drivers/net/wireless/
+
 NETXEN (1/10) GbE SUPPORT
 P:	Dhananjay Phadke
 M:	[email protected]
#4 lore raw

Re: [PATCH] MAINTAINERS: Add networking wireless drivers section

Quoted 11 lines · On Tue, 28 Jul 2009 11:06:37 -0700 Joe Perches wrote:
Quoted 2 lines · David Miller

Wireless patches need to be CC:'d to linux-wireless so that John Linville can notice and pick them up

MAINTAINERS +0 -0
index ebc2691..0574aad 100644

MAINTAINERS T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git · line 4194

Quoted 9 lines
MAINTAINERS +6 -0
@@ -4186,6 +4186,12 @@ T:	git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
 S:	Odd Fixes
 F:	drivers/net/
 
+NETWORKING WIRELESS DRIVERS
+L:	[email protected]
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
+S:	Odd Fixes
+F:	drivers/net/wireless/
+

Already have this:

NETWORKING [WIRELESS]
P: John W. Linville
M: [email protected]
L: [email protected]
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
S: Maintained
F: net/wireless/
F: include/net/ieee80211*
F: include/linux/wireless.h

---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

#5 lore raw

Re: [PATCH] MAINTAINERS: Add networking wireless drivers section

Quoted 22 lines · Randy Dunlap
Quoted 9 lines · On Tue, 28 Jul 2009 11:06:37 -0700 Joe Perches wrote:
Quoted 2 lines · David Miller

Wireless patches need to be CC:'d to linux-wireless so that John Linville can notice and pick them up

MAINTAINERS +0 -0
index ebc2691..0574aad 100644

MAINTAINERS T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git · line 4194

Quoted 9 lines
MAINTAINERS +6 -0
@@ -4186,6 +4186,12 @@ T:	git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
 S:	Odd Fixes
 F:	drivers/net/
 
+NETWORKING WIRELESS DRIVERS
+L:	[email protected]
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
+S:	Odd Fixes
+F:	drivers/net/wireless/
+

Already have this:

Quoted 9 lines

NETWORKING [WIRELESS]
P: John W. Linville
M: [email protected]
L: [email protected]
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
S: Maintained
F: net/wireless/
F: include/net/ieee80211*
F: include/linux/wireless.h

That section does not include drivers/net/wireless/

I believe John Linville isn't maintaining all the wireless drivers, he's acting as a gatekeeper in a similar role as DavidM for drivers/net/.

The patch above means scripts/get_maintainer.pl can use the linux-wireless@vger list email address for any change in driver/net/wireless/

maintainer
#6 lore raw

Re: [PATCH] MAINTAINERS: Add networking wireless drivers section

From: Joe Perches <[email protected]>
Date: Tue, 28 Jul 2009 11:27:07 -0700

Quoted 33 lines · Randy Dunlap
Quoted 22 lines · On Tue, 28 Jul 2009 11:06:37 -0700 Joe Perches wrote:
Quoted 9 lines · David Miller
Quoted 2 lines

Wireless patches need to be CC:'d to linux-wireless so that John Linville can notice and pick them up

MAINTAINERS +0 -0
index ebc2691..0574aad 100644

MAINTAINERS T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git · line 4194

Quoted 9 lines
MAINTAINERS +6 -0
@@ -4186,6 +4186,12 @@ T:	git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
 S:	Odd Fixes
 F:	drivers/net/
 
+NETWORKING WIRELESS DRIVERS
+L:	[email protected]
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
+S:	Odd Fixes
+F:	drivers/net/wireless/
+

Already have this:

Quoted 9 lines

NETWORKING [WIRELESS]
P: John W. Linville
M: [email protected]
L: [email protected]
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
S: Maintained
F: net/wireless/
F: include/net/ieee80211*
F: include/linux/wireless.h

Quoted 1 line

That section does not include drivers/net/wireless/

So just add it.

Quoted 3 lines

I believe John Linville isn't maintaining all the
wireless drivers, he's acting as a gatekeeper in
a similar role as DavidM for drivers/net/.

It still needs to hit his inbox and linux-wireless regardless.

maintainer
#7 lore raw

Re: [PATCH] MAINTAINERS: Add networking wireless drivers section

In reply to Joe Perches

From: Joe Perches <[email protected]>
Date: Tue, 28 Jul 2009 11:06:37 -0700

Quoted 5 lines · David Miller
Quoted 2 lines

Wireless patches need to be CC:'d to linux-wireless so that John Linville can notice and pick them up

Why not just create a plain "WIRELESS" umbrella entry that contains all of drivers/net/wireless, net/mac80211, and net/wireless?

#8 lore raw

Re: [PATCH] MAINTAINERS: Add networking wireless drivers section

Quoted 4 lines · David Miller

From: Joe Perches <[email protected]>
Date: Tue, 28 Jul 2009 11:06:37 -0700

Quoted 1 line · David Miller
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Wireless patches need to be CC:'d to linux-wireless so that John Linville can notice and pick them up

Why not just create a plain "WIRELESS" umbrella entry that contains all of drivers/net/wireless, net/mac80211, and net/wireless?

Whatever works for John I suppose.
John, do you have a preference?

I was trying to avoid the "S: Maintained" label
and was copying the form of this section:

NETWORKING DRIVERS
L: [email protected]
W: http://www.linuxfoundation.org/en/Net
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
S: Odd Fixes
F: drivers/net/

#9 lore raw

Re: [PATCH] MAINTAINERS: Add networking wireless drivers section

Quoted 6 lines · Joe Perches
Quoted 2 lines

Why not just create a plain "WIRELESS" umbrella entry that contains all of drivers/net/wireless, net/mac80211, and net/wireless?

Whatever works for John I suppose. John, do you have a preference? I was trying to avoid the "S: Maintained" label
and was copying the form of this section:

Quoted 6 lines

NETWORKING DRIVERS
L: [email protected]
W: http://www.linuxfoundation.org/en/Net
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
S: Odd Fixes
F: drivers/net/

Just out of curiosity, why is drivers/net marked as "Odd fixes" and not "Maintained"?

Signature · 2 lines
Jiri Kosina
SUSE Labs
maintainer
#10 lore raw

Re: [PATCH] MAINTAINERS: Add networking wireless drivers section

From: Jiri Kosina <[email protected]>
Date: Tue, 11 Aug 2009 15:55:46 +0200 (CEST)

Quoted 15 lines · Joe Perches
Quoted 7 lines
Quoted 3 lines

Why not just create a plain "WIRELESS" umbrella entry that contains all of drivers/net/wireless, net/mac80211, and net/wireless?

Whatever works for John I suppose. John, do you have a preference? I was trying to avoid the "S: Maintained" label
and was copying the form of this section:

Quoted 6 lines

NETWORKING DRIVERS
L: [email protected]
W: http://www.linuxfoundation.org/en/Net
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
S: Odd Fixes
F: drivers/net/

Quoted 2 lines

Just out of curiosity, why is drivers/net marked as "Odd fixes" and not "Maintained"?

Because it depends upon the individual driver maintainers. For example, I don't think one could claim 3c515.c or other ISA ethernet drivers to be in any kind of "Maintained" state.

maintainer
#11 lore raw

Re: [PATCH] MAINTAINERS: Add networking wireless drivers section

In reply to David Miller
Quoted 4 lines · David Miller

From: Joe Perches <[email protected]>
Date: Tue, 28 Jul 2009 11:06:37 -0700

Quoted 1 line · David Miller
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Wireless patches need to be CC:'d to linux-wireless so that John Linville can notice and pick them up

Why not just create a plain "WIRELESS" umbrella entry that contains all of drivers/net/wireless, net/mac80211, and net/wireless?

I'll happily maintain net/mac80211 and net/wireless, but won't be touching all the old crappy drivers/net/wireless with a long stick.

johannes