Skip to contentSkip to conversation

staging: slicoss: Move NULL test closer to assignment

PATCH New Rehas Sachdeva 1 participant 1 message Sep 21, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: slicoss: Move NULL test closer to assignment

Move the test to check if a variable is NULL, to right after it is being assigned, rather than some statements later.

---
 drivers/staging/slicoss/slicoss.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/slicoss/slicoss.c +3 -3
index 714e6e1..062307a 100644
@@ -2617,15 +2617,15 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 					       sizeof(struct slic_eeprom),
 					       &phys_config);
 
-		phys_configl = SLIC_GET_ADDR_LOW(phys_config);
-		phys_configh = SLIC_GET_ADDR_HIGH(phys_config);
-
 		if (!peeprom) {
 			dev_err(&adapter->pcidev->dev,
 				"Failed to allocate DMA memory for EEPROM.\n");
 			return -ENOMEM;
 		}
 
+		phys_configl = SLIC_GET_ADDR_LOW(phys_config);
+		phys_configh = SLIC_GET_ADDR_HIGH(phys_config);
+
 		memset(peeprom, 0, sizeof(struct slic_eeprom));
 
 		slic_write32(adapter, SLIC_REG_ICR, ICR_INT_OFF);
Signature · 1 line
2.7.4