From: Kulikov Vasiliy <segooon@gmail.com>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Lior Dotan <liodot@gmail.com>, <charrer@alacritech.com>,
Denis Kirjanov <kirjanov@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jiri Pirko <jpirko@redhat.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/5] staging: slicoss: Move NULL pointer assertion to else branch
Date: Sun, 27 Jun 2010 17:20:45 +0400 [thread overview]
Message-ID: <1277644847-16292-3-git-send-email-segooon@gmail.com> (raw)
In-Reply-To: <1277644847-16292-1-git-send-email-segooon@gmail.com>
Move NULL pointer assertion to else branch because it can
become NULL only here.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
drivers/staging/slicoss/slicoss.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 102d3ea..86bc733 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -2263,11 +2263,11 @@ static u32 slic_card_locate(struct adapter *adapter)
break;
card = card->next;
}
+ ASSERT(card);
+ if (!card)
+ return -ENOMEM;
}
- ASSERT(card);
- if (!card)
- return -ENOMEM;
/* Put the adapter in the card's adapter list */
ASSERT(card->adapter[adapter->port] == NULL);
if (!card->adapter[adapter->port]) {
--
1.7.0.4
next prev parent reply other threads:[~2010-06-27 13:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-27 13:20 [PATCH 1/5] staging: slicoss: Change return codes to -EYYY Kulikov Vasiliy
2010-06-27 13:20 ` Kulikov Vasiliy [this message]
2010-07-08 20:11 ` [PATCH 3/5] staging: slicoss: Move NULL pointer assertion to else branch Greg KH
2010-06-27 13:20 ` [PATCH 4/5] staging: slicoss: error handling with goto Kulikov Vasiliy
2010-06-27 13:20 ` [PATCH 5/5] " Kulikov Vasiliy
2010-06-28 10:12 ` [PATCH 1/5] staging: slicoss: Change return codes to -EYYY Denis Kirjanov
2010-06-28 11:14 ` Kulikov Vasiliy
2010-06-28 14:12 ` Denis Kirjanov
2010-06-30 13:02 ` Kulikov Vasiliy
2010-06-30 13:02 ` Kulikov Vasiliy
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=1277644847-16292-3-git-send-email-segooon@gmail.com \
--to=segooon@gmail.com \
--cc=charrer@alacritech.com \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=jpirko@redhat.com \
--cc=kirjanov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liodot@gmail.com \
/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
Powered by JetHome