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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux