Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3475748rwa; Tue, 23 Aug 2022 05:30:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR5y9hNKHgVMAUrcydS/d+gzWo1QCHxpbHzh4W9oLa491b9a12Q3T+bkLX+CsjEXSupEHjlA X-Received: by 2002:a05:6402:1d4d:b0:447:67b:2631 with SMTP id dz13-20020a0564021d4d00b00447067b2631mr3464283edb.243.1661257667811; Tue, 23 Aug 2022 05:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257667; cv=none; d=google.com; s=arc-20160816; b=lQTKKtYeshsLXdQ0wdQoFTtMzsZ3QsYQIqL3hOT0gKDHXz8CwUbNY07E4nldRQ7sXb tOQEIIBTrrhhY55kNLMn9HFmSRDq1yYXQbth1RhWDNdA2n7DMjiD0DtTqlMUHuzolAqH 3fXyT32/10IUPNyfi3cxK3CtJeXobY7bnHceDLGgkoevnqEui9f/hsPIVptX1bOW2K8n LSpv8LgaVdyLthS4xpcmFTK3k/uDkwQxFP3AQPX0NT83FEb6tmTGXQLZnc3944F/WUiX BmZ2k3Xlt6EgnpvkYVeImh/6lhS/TfN8+zG+nJNPeGvsEDi2ADPbC1pvD87Brlijokax VUGg== 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=y7b6yLFpgR9/3iLg8NwujZH3U8fkseKQFtzmsrcHIiU50hAUz7ycTDHIl+gjwlWNmm f8RtlW5OumnMQFxlUzOvI5oNig6INLYtevR2fQSxVik4htWiiS2uCsUw7E69BYQJO77b Q7vKBXzo9poMFuxgFqVGUetPoRE9M5tdsuZGXs8aOm4UaRnr4VaSuhx3FuCXyDyhokXa NXg4TyfJRjgJYQr8xp9lMdUyRC8B29VNnjU+tmuSJzia8aULA1DcaczKFQULEZUHkPze oXYx8f4shF6jSA4MhxBccYBSdhifdhlAlUv7d5NbBVzqBAxhOSuJRlb+6HjbpmK52U9o BVEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QeNYWMiP; 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 sa40-20020a1709076d2800b0073dab845a38si141752ejc.346.2022.08.23.05.27.19; Tue, 23 Aug 2022 05:27:47 -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=QeNYWMiP; 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 S240439AbiHWJnE (ORCPT + 99 others); Tue, 23 Aug 2022 05:43:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351818AbiHWJkd (ORCPT ); Tue, 23 Aug 2022 05:40:33 -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 B600779686; Tue, 23 Aug 2022 01:41:29 -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 103E06152E; Tue, 23 Aug 2022 08:40:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14DD5C433C1; Tue, 23 Aug 2022 08:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244041; bh=UnsYK3CCZV3d4U2OT6f8xJcmMIqfdF3LWGKXGLp2kE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QeNYWMiPcAU7XSz8sblioW0AFHTwHleTTWA01yyccx8GKInLCtXC9H5uN3wkRx5Xw 4n9F1R3wd6f5V2P7dxqsVQYoB5kdQ0Xck0LCHXBmU+8OZnKt0BU7y8BbGfK/GKvlpt 8HPh5INeZwNKsXdzzI7+bN1gaMt8uus7Br+A9lgE= 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.14 077/229] wifi: p54: Fix an error handling path in p54spi_probe() Date: Tue, 23 Aug 2022 10:23:58 +0200 Message-Id: <20220823080056.464724503@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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