netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] hostap_ap.c:hostap_add_sta(): inconsequent NULL checking
@ 2006-03-10 19:10 Adrian Bunk
  2006-03-13  1:23 ` Jouni Malinen
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2006-03-10 19:10 UTC (permalink / raw)
  To: jkmaline; +Cc: hostap, netdev, linux-kernel

The Coverity checker spotted this inconsequent NULL checking 
(unconditionally dereferencing directly after checking for NULL
isn't a good idea).


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.16-rc5-mm3-full/drivers/net/wireless/hostap/hostap_ap.c.old	2006-03-10 19:30:08.000000000 +0100
+++ linux-2.6.16-rc5-mm3-full/drivers/net/wireless/hostap/hostap_ap.c	2006-03-10 19:30:43.000000000 +0100
@@ -3141,7 +3141,7 @@ int hostap_add_sta(struct ap_data *ap, u
 	if (ret == 1) {
 		sta = ap_add_sta(ap, sta_addr);
 		if (!sta)
-			ret = -1;
+			return -1;
 		sta->flags = WLAN_STA_AUTH | WLAN_STA_ASSOC;
 		sta->ap = 1;
 		memset(sta->supported_rates, 0, sizeof(sta->supported_rates));

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

* Re: [2.6 patch] hostap_ap.c:hostap_add_sta(): inconsequent NULL checking
  2006-03-10 19:10 [2.6 patch] hostap_ap.c:hostap_add_sta(): inconsequent NULL checking Adrian Bunk
@ 2006-03-13  1:23 ` Jouni Malinen
  0 siblings, 0 replies; 2+ messages in thread
From: Jouni Malinen @ 2006-03-13  1:23 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: hostap, netdev, linux-kernel

On Fri, Mar 10, 2006 at 08:10:26PM +0100, Adrian Bunk wrote:
> The Coverity checker spotted this inconsequent NULL checking 
> (unconditionally dereferencing directly after checking for NULL
> isn't a good idea).

Thanks! Added to my queue for wireless-2.6.

-- 
Jouni Malinen                                            PGP id EFC895FA

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

end of thread, other threads:[~2006-03-13  1:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-10 19:10 [2.6 patch] hostap_ap.c:hostap_add_sta(): inconsequent NULL checking Adrian Bunk
2006-03-13  1:23 ` Jouni Malinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).