Commit fb9693f0 authored by Markus Elfring's avatar Markus Elfring Committed by Kalle Valo

iwlegacy: Return directly if allocation fails in il_eeprom_init()

Also remove an unused label.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Acked-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
[Rewrote commit message]
Signed-off-by: default avatarJulian Calaby <julian.calaby@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 9e12904a
......@@ -723,10 +723,9 @@ il_eeprom_init(struct il_priv *il)
sz = il->cfg->eeprom_size;
D_EEPROM("NVM size = %d\n", sz);
il->eeprom = kzalloc(sz, GFP_KERNEL);
if (!il->eeprom) {
ret = -ENOMEM;
goto alloc_err;
}
if (!il->eeprom)
return -ENOMEM;
e = (__le16 *) il->eeprom;
il->ops->apm_init(il);
......@@ -778,7 +777,6 @@ il_eeprom_init(struct il_priv *il)
il_eeprom_free(il);
/* Reset chip to save power until we load uCode during "up". */
il_apm_stop(il);
alloc_err:
return ret;
}
EXPORT_SYMBOL(il_eeprom_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment