Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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);