projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d359a8
)
staging: slicoss: Move NULL test closer to assignment
author
Rehas Sachdeva
<
[email protected]
>
Wed, 21 Sep 2016 18:36:51 +0000
(
00:06
+0530)
committer
Greg Kroah-Hartman
<
[email protected]
>
Thu, 22 Sep 2016 09:54:48 +0000
(11:54 +0200)
Move the test to check if a variable is NULL, to right after it is being
assigned, rather than some statements later.
Signed-off-by: Rehas Sachdeva <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/staging/slicoss/slicoss.c
patch
|
blob
|
history
diff --git
a/drivers/staging/slicoss/slicoss.c
b/drivers/staging/slicoss/slicoss.c
index 714e6e19d76f5ce76f54e69b3a586e7e41d4e686..062307ad7fed679d40bc3aee4a45b7af4f8f1904 100644
(file)
--- a/
drivers/staging/slicoss/slicoss.c
+++ b/
drivers/staging/slicoss/slicoss.c
@@
-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);