Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3407404rwa; Tue, 23 Aug 2022 04:23:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR7VeJJojJPPsJyVn5lhWrg0VHxQqQvH7wjfYUclTo2TUeMnGe8rp9AlZyJ8weu60QyHEirZ X-Received: by 2002:a17:902:db05:b0:172:f759:f989 with SMTP id m5-20020a170902db0500b00172f759f989mr5449429plx.58.1661253789503; Tue, 23 Aug 2022 04:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253789; cv=none; d=google.com; s=arc-20160816; b=l1+OJd88rcJ3xX0ue8tXiFybw0Sjn1rsoclU94x4IvuBY3ZacYjAXw2pAlaLArtf3o a1c0VIXvTxQCKjih73IgnVwG7NK2fjAuy6lsXOmrv1jTXeMNS+4vylB1AirHZZlTirPn gYJtldQg5fcupSCC53FdbKi+BHMo1eTNDU7YZrHND46Ha1uRCcFQEzT3sye0VPoDuK7x 2hqawOSg3zK0dn7w80H4Qum4hPMRNzz22h6o85T+YO4oA5nfoVD3V1I7ToTEEfHwJIvQ pCfwIGjYdIXdaHmOvoLQiQXSniq+bh0BOL9MLKLTpYWJvJqA5CcyQ8aL7HzAwZIILx2R SsHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t97YKpYyYU2X8fTDLIBDDQmqNaJ0m232h56jAxxstiI=; b=KqrXtOR4cmOXr81Vj2MBDfkII8hUHerFXTpeYhrQvRx0t3GMJeU1ueDNeeo7SzNyKa iYx5KCTOXSMjbkhbfDUzT9dM/PH2mLlhJvd9KNIPamAmo3t94tfiblrLVov700IlzmED sOuQPLhhF1hfGadUJncEfQhX3RiLQOK8gAqkXfi3Genlp2/AHJV7MBmWvr+FazfI5cTJ 0X/k1dGKeT79hXluPAWcEyf/HRi6rts7+QANNtiqDBQnMEkq8ETizWqXkxBdr7OxMJUo FG9meNVKw7Pdf22j4rbxcJuX1A+3vbVOD6kRU44bnIBQwrw+VH1nIzCmBNjZpSPct3kh hN4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Wp+o2TCf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t32-20020a634460000000b00415ef8c15f1si14462422pgk.486.2022.08.23.04.22.58; Tue, 23 Aug 2022 04:23:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Wp+o2TCf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351175AbiHWKjp (ORCPT + 99 others); Tue, 23 Aug 2022 06:39:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353843AbiHWKX7 (ORCPT ); Tue, 23 Aug 2022 06:23:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0659EA3D4C; Tue, 23 Aug 2022 02:04:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 67A7C61589; Tue, 23 Aug 2022 09:04:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6ADB2C433B5; Tue, 23 Aug 2022 09:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245482; bh=UnsYK3CCZV3d4U2OT6f8xJcmMIqfdF3LWGKXGLp2kE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wp+o2TCfC6SgQxji6J+i0tfHIbd5d8qJTOp4F6Myy00aIGq6Pe/Y31bdTugGUTIGu H5GqAYPMXFmij005RuDKd7UmDrmIwZDMa3+c34vn/xWzhvoN3maMEm653HjP1NnX9/ K4LlbuysMrMY1oh0wISgmUb10Zb6djlnu9rQHn4k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Christian Lamparter , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 092/287] wifi: p54: Fix an error handling path in p54spi_probe() Date: Tue, 23 Aug 2022 10:24:21 +0200 Message-Id: <20220823080103.406277168@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 83781f0162d080fec7dcb911afd1bc2f5ad04471 ] If an error occurs after a successful call to p54spi_request_firmware(), it must be undone by a corresponding release_firmware() as already done in the error handling path of p54spi_request_firmware() and in the .remove() function. Add the missing call in the error handling path and remove it from p54spi_request_firmware() now that it is the responsibility of the caller to release the firmware Fixes: cd8d3d321285 ("p54spi: p54spi driver") Signed-off-by: Christophe JAILLET Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/297d2547ff2ee627731662abceeab9dbdaf23231.1655068321.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/net/wireless/intersil/p54/p54spi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intersil/p54/p54spi.c b/drivers/net/wireless/intersil/p54/p54spi.c index e41bf042352e..3dcfad5b61ff 100644 --- a/drivers/net/wireless/intersil/p54/p54spi.c +++ b/drivers/net/wireless/intersil/p54/p54spi.c @@ -177,7 +177,7 @@ static int p54spi_request_firmware(struct ieee80211_hw *dev) ret = p54_parse_firmware(dev, priv->firmware); if (ret) { - release_firmware(priv->firmware); + /* the firmware is released by the caller */ return ret; } @@ -672,6 +672,7 @@ static int p54spi_probe(struct spi_device *spi) return 0; err_free_common: + release_firmware(priv->firmware); free_irq(gpio_to_irq(p54spi_gpio_irq), spi); err_free_gpio_irq: gpio_free(p54spi_gpio_irq); -- 2.35.1