Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3083995rwb; Mon, 15 Aug 2022 17:44:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR5NgXiiW1uTdGpitbxjiuRPIEdxp2aC9C5ezeQvS3hDv5XDdntE485tE/L2VY3vuxv69e0E X-Received: by 2002:a17:907:94d6:b0:730:bfe6:8352 with SMTP id dn22-20020a17090794d600b00730bfe68352mr11781035ejc.348.1660610654288; Mon, 15 Aug 2022 17:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610654; cv=none; d=google.com; s=arc-20160816; b=CoizGWOyMEiM2AYGJWA2/xZtpgb7GuruGFBpGm5LQVq5INHQY0Hzb5Lu5WlK+JhczM ix8nWJsYT/FMJSOohPSovIJ6mkuLGwuQ0JvS+LrJZPj96szSwe7jO5rj+t8pSuV9rtbt 3iPj40hEoOGEtRQ3OUztjybaoysbZ7kysews6X+XpV66xl2Rpl6HP6huvgabEORIjH8Q nnx5488PJ+X93LoEbT75K2SmeUhCqI5SSmpjHKYbymW9/r+kLGYeYrLSdeys05HkPOhZ nA2K/TwUxLY+B38z80AnFC4I3J+wZ90ONioL6QyPdkEQ/mMtvawL28fqiC8W6Ghu4Jkp JluQ== 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=agf1+0Rg/1B1TYlHIyKxEQZJWVuebhsWvhdBHKjNXVE=; b=mLLP8aclgtz5jo6esx+QfIINhl8AX/RnAOqyP+W54knvDVFKjYrFieFc+Dn2DaL9ls RDtaJqYYL64mUBa5stTiNUr3eeA0Mt3CpkZHGAnXrSyuErwPF9HVOT+SKNGKCwl4wuEq 72tC8eTQqKw3KtIcBBSQhiL6AHKrSt6KkVC6q9J2/OUgLGJ3OAaGnqFZTlQmaTmJWgo3 2AQ+9uNovaf9GutWTTR5XnwlmcCFQ1BmUlX2lk9uRdp96b7Q1Tjsn346vP3Y5AoARpWQ A27z9QDO7kEVdFsEGesdoA8ngpcFaqhsd2N1zpPaVZQMx2EvjexP83WC7grZwqF1Qb0g QWjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pzsDUnCj; 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 he33-20020a1709073da100b0072f0a99a61asi9576075ejc.617.2022.08.15.17.43.49; Mon, 15 Aug 2022 17:44:14 -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=pzsDUnCj; 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 S1353277AbiHOX7Y (ORCPT + 99 others); Mon, 15 Aug 2022 19:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355603AbiHOXwi (ORCPT ); Mon, 15 Aug 2022 19:52:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F965C59F0; Mon, 15 Aug 2022 13:17:11 -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 ams.source.kernel.org (Postfix) with ESMTPS id EDDA1B80EAD; Mon, 15 Aug 2022 20:17:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 618AAC433D6; Mon, 15 Aug 2022 20:17:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594628; bh=0UKjixtL0eNbQD7Gi+0rqyBPU1iqbuobQHBHws/8h70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pzsDUnCjrinYwoeso+0SDtMT545zyiyIWQqpfUGCrQNHlSCPJkDnhNcZ4jdAA78ZW NFF8kc7frJpV4/xik8nNqIRsNFIR8lxFHglWBzlzc5vSdM0MkGTGEXzDzd7xd+Ul+0 l5nI05k8Hquvp3ghSpjsnGxy8va5UGn2800L+wGI= 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 5.19 0507/1157] wifi: p54: Fix an error handling path in p54spi_probe() Date: Mon, 15 Aug 2022 19:57:43 +0200 Message-Id: <20220815180459.980894967@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 f99b7ba69fc3..19152fd449ba 100644 --- a/drivers/net/wireless/intersil/p54/p54spi.c +++ b/drivers/net/wireless/intersil/p54/p54spi.c @@ -164,7 +164,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; } @@ -659,6 +659,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