netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: jkmaline@cc.hut.fi
Cc: hostap@shmoo.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [2.6 patch] hostap_ap.c:hostap_add_sta(): inconsequent NULL checking
Date: Fri, 10 Mar 2006 20:10:26 +0100	[thread overview]
Message-ID: <20060310191026.GS21864@stusta.de> (raw)

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

             reply	other threads:[~2006-03-10 19:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-10 19:10 Adrian Bunk [this message]
2006-03-13  1:23 ` [2.6 patch] hostap_ap.c:hostap_add_sta(): inconsequent NULL checking Jouni Malinen

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=20060310191026.GS21864@stusta.de \
    --to=bunk@stusta.de \
    --cc=hostap@shmoo.com \
    --cc=jkmaline@cc.hut.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).