From patchwork Fri Mar 18 02:23:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Calaby X-Patchwork-Id: 8615791 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 02322C0553 for ; Fri, 18 Mar 2016 02:23:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 284CE20306 for ; Fri, 18 Mar 2016 02:23:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 56C5A202FE for ; Fri, 18 Mar 2016 02:23:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752630AbcCRCXz (ORCPT ); Thu, 17 Mar 2016 22:23:55 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:34630 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361AbcCRCXy (ORCPT ); Thu, 17 Mar 2016 22:23:54 -0400 Received: by mail-pf0-f169.google.com with SMTP id x3so145843164pfb.1 for ; Thu, 17 Mar 2016 19:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4UGX1HLEBrpLsaSzZdJmSe97pi7Vrkv7gOnanje9AW0=; b=EBmFOArhfC5AzHOBe7757b+vBYJNB9+7v+Vc8ey9mZkcH18QhsIH1M27LSJU/YCCXY ZFHekWyx/O4KJwktrs2+HGTkKq8gkfQrAu8B4eOuZq5poE2nXKIpD1D2GZ8O3cKkYn8t bhUBgN01aEuszoF1OSs57N8BEROqs5eQlq9xJfsFUS6qagUqpOckjAQMjU7fe8NvKbKr SVywac8cdH58OqXJtanOTA7WPPtZYM6uj+RiNYSt2o/vgaxFAaqHKydKOpAV5Twpdrjg in+kTZdWzJYvcL8Q0oKKVcNjFtArJZnLqEwzpBjDk/L7UcEEVzOlA1ThK5J7elqMQENW uR2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4UGX1HLEBrpLsaSzZdJmSe97pi7Vrkv7gOnanje9AW0=; b=EcdNnHGDR4tIU9EL/cztKFMvYv+HBACfm5R+ANKV4cOskPD26nvU6bLZ4Wj5p/j4/X H2z/C7eQ8GkCYp+9l9vSalIlvvhmw6dBYvwKEDrCrXY8fPBtnEooU8loBt7qu6Kir3jy s6r3nq2jZhVLw7QpTZVYOQyOYlhgpoXHBCq92OLhqweA/owT21fwQLVIDh7Ymy2+UUWZ pdncZblTTIjoGgXA3NYni9PAB3iaEPq4/pnuztHczBkK5GgUGI2A3qEqF+coUcbPDmWj x8CVvBBlEs8sIAV4BOhBGASVWEln5uBegop309Z7cg8uFy3RTvEhUwOollvxtLvPQoxv Oa9Q== X-Gm-Message-State: AD7BkJLwHfPoybvCqgt7OCAfYSL/IkbEjDGVlyM+kEl78TuqZhOOLJhZWrcN8bDsZb+7Pw== X-Received: by 10.66.218.196 with SMTP id pi4mr19786301pac.147.1458267833456; Thu, 17 Mar 2016 19:23:53 -0700 (PDT) Received: from multimedia.lan (C-59-101-14-180.hay.connect.net.au. [59.101.14.180]) by smtp.gmail.com with ESMTPSA id 27sm16373826pfo.58.2016.03.17.19.23.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Mar 2016 19:23:52 -0700 (PDT) From: Julian Calaby To: Kalle Valo Cc: Stanislaw Gruszka , Markus Elfring , Arnd Bergmann , Dan Carpenter , Jia-Ju Bai , linux-wireless@vger.kernel.org Subject: [PATCH 08/19] iwlegacy: Return directly if allocation fails in il_eeprom_init() Date: Fri, 18 Mar 2016 13:23:46 +1100 Message-Id: <01ae52425e9dba9f82f8d107da02a0d2cd23f09d.1458262312.git.julian.calaby@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Also remove an unused label. Signed-off-by: Markus Elfring Acked-by: Stanislaw Gruszka [Rewrote commit message] Signed-off-by: Julian Calaby --- drivers/net/wireless/intel/iwlegacy/common.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index eb5cb60..c3afaf7 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);