提交 fb9693f0 编写于 作者: M Markus Elfring 提交者: Kalle Valo

iwlegacy: Return directly if allocation fails in il_eeprom_init()

Also remove an unused label.
Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
Acked-by: NStanislaw Gruszka <sgruszka@redhat.com>
[Rewrote commit message]
Signed-off-by: NJulian Calaby <julian.calaby@gmail.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册