Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2927059rwb; Mon, 15 Aug 2022 14:12:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR5LK+RT4NNyMVjh6yT9cgbQlfhoc28YDCriBAIVKseUoNP42VluAbY9Aoy8su1RMImsTvuq X-Received: by 2002:a17:90b:3e88:b0:1f5:6029:1bf7 with SMTP id rj8-20020a17090b3e8800b001f560291bf7mr30462507pjb.155.1660597948563; Mon, 15 Aug 2022 14:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597948; cv=none; d=google.com; s=arc-20160816; b=NgjlL38EhZORmU6riuoGFIG5joySVbkXUYZ5/39orPA51P+ZGO6Q3hhzaf84SKkSkj 5yGseqWKutTvYIyoRjvJh6eAjIDjeryS8m+LAY3JQpCHFDsHOVc3LoKXj2cKUaT07EJL gkrLYbf0VBCRtgOdHSCnRPcNHE0Y9U9yoGdUarXbf7iSefXLeHrLkZYmoHcK+5REAlm2 CDpvb8PZLJ2A2f4OpziQNZVyRRL92Vnec1cZkkY6RYfov1coPUU4Kod6+A4OjG/AnuYV d/VKZjejpPn41M6R8yJLjY2G18HjpluxRC9ydRA5unPt7t4WN6o70egcAURrW1dmmzDa gkZg== 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=2zLrcpEc4pNPSw/mdu200fterEdGGKlH2cxrCvVddHQ=; b=vj8LErcMAcFagyOcy7NUcYyqz0h1dlsQH2/iynTywGhMbe6MFDH+sTtFuxrSaX5So3 SMLFXyyv/dfjboIsPn3HPSZgBWvYXPdzmMn/9OLo662+lV6UfMFigKnvioO3XFaWw7Br ITU/+pRC3KjQYx/9XM4pr+MWmMPVwxYclcnnmNX9r8MJsB9YQJPG5xoIeKVkbJQnmaHI hs1wxx6bYScHvoiBInfXgE0p37eyw9mzIhWFd1T8TwH1IVmBh4/TcQOAI+M3nNFxQq29 ZOBm74nSxozwwSSDXqw0FpKrJu1nhZOzJ46jsiSEMNriC5oQEpvB81rGSj8MuOpEpdXJ KWAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RMNJowNv; 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 v22-20020a636116000000b00415d3667232si11542189pgb.63.2022.08.15.14.12.15; Mon, 15 Aug 2022 14:12:28 -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=RMNJowNv; 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 S244919AbiHOS7s (ORCPT + 99 others); Mon, 15 Aug 2022 14:59:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245005AbiHOS43 (ORCPT ); Mon, 15 Aug 2022 14:56:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 730C22C65E; Mon, 15 Aug 2022 11:31:08 -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 9EA0FB8106C; Mon, 15 Aug 2022 18:31:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AD05C433C1; Mon, 15 Aug 2022 18:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588265; bh=NOfUXmPqSk1PmDgPrBf/kn0GN7etkIuaEtAbPGOg2Ns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RMNJowNv7WoyatQTP+9C1+VIxy57huKsSx16lVCGRyA2efSGDqXXq6T1ZhRQqTUWl BGCfEo48l2fwvDOBH82w1xJrmcYrCBGNlPzVUHdNDcd0BMdMY1+RjhLPLD1MMp7wiD nYu2AkmUcBwXtbAXewCovua3qTYZvni2Y1ZfiI7M= 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.15 347/779] wifi: p54: Fix an error handling path in p54spi_probe() Date: Mon, 15 Aug 2022 19:59:51 +0200 Message-Id: <20220815180352.072639286@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 ab0fe8565851..cdb57819684a 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