From: Markus Elfring Date: Fri, 18 Mar 2016 02:23:46 +0000 (+1100) Subject: iwlegacy: Return directly if allocation fails in il_eeprom_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fb9693f04544068e6176051ce5b96e4574730107;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iwlegacy: Return directly if allocation fails in il_eeprom_init() Also remove an unused label. Signed-off-by: Markus Elfring Acked-by: Stanislaw Gruszka [Rewrote commit message] Signed-off-by: Julian Calaby Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index eb5cb603bc52..c3afaf71066e 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c @@ -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 @@ err: 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);