iwlegacy: Return directly if allocation fails in il_eeprom_init()
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 18 Mar 2016 02:23:46 +0000 (13:23 +1100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 7 Apr 2016 16:37:42 +0000 (19:37 +0300)
Also remove an unused label.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
[Rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/intel/iwlegacy/common.c

index eb5cb60..c3afaf7 100644 (file)
@@ -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);