[PATCH 3/5] staging: slicoss: Move NULL pointer assertion to else branch

From: Kulikov Vasiliy
Date: Sun Jun 27 2010 - 09:22:04 EST


Move NULL pointer assertion to else branch because it can
become NULL only here.

Signed-off-by: Kulikov Vasiliy <segooon@xxxxxxxxx>
---
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

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