Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3017919rwb; Mon, 15 Aug 2022 16:14:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR7VBsODP4XYzI1vyNZ8qPOndmj2sKvXbJe77Sa1aQlFtSKalNjh+7U62lPMYFGth1blS4+y X-Received: by 2002:a05:6402:2b8d:b0:43a:5410:a9fc with SMTP id fj13-20020a0564022b8d00b0043a5410a9fcmr16525348edb.99.1660605277348; Mon, 15 Aug 2022 16:14:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605277; cv=none; d=google.com; s=arc-20160816; b=OIkTjtCcQsP2/TWso4W2CnDqSNC9iSutyd6KNn74p/YZ/H+QXZPg391Ruv6imMVhYQ M2RnDcrki5kZ2x/7h+WF2Fvz4kIwHQcBjawp60IOYkqi8H2nwcFu3zYiMiQlGV24E3Qm Z0An6YJPysENkvMeFPAsAoqL3eI9R/80JX+PcOhmwKK18HqKMefxLiVztxeRn4/8hzt2 SUB+b4+DA9F36kfzch0GKTCjcdgF+JM+Um1DQWU7XxM2GdDuyDqu6YzvGpyD3VViFs8X d3Xj3o1rSi/tnqOa9vlLBgh70JRj4sYQOA0MR0la4IynzGNv8oJJB40mbTJB9wCJlkSS Drnw== 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=ix4tlTM73NStMSghvz9TJ4Kd7We/XE9UPwIBOCjx7Kw=; b=dpyBsk3WaMOnCqhNwIgTdFoEMfgVTHq6kCozXuDMc7ugSKN3TZOBckRMfgoeRny5J1 KRoKa3RZ8L/yeaAm97NM28BmRDf+RymQ3CbwYOgUTxm7Auai/i9iW2jcNp/pLsqu955T /ZfLHx9+kEd5cAqT0MTGXFaxp5G0EOg1Lh4gj7h7tRtpUrZghzcZGGhL8vhGyxFLZi6b iGJyIimEBVtJFz0tUNiUDYeZe+QhNHIqpEi8Cfncd6Wi+QDb2yyh1lebNq/IGPlEtRS1 C/Tv+k6b/SoUXLMk8lYbJfJyafLgVcmCeuqTFzo2Z5f5sdglf/cC5ZzAtT7n9wyTTGWo BPrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="063c/KeT"; 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 z21-20020a05640240d500b0043d9c8dbfd9si10772745edb.31.2022.08.15.16.14.10; Mon, 15 Aug 2022 16:14:37 -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="063c/KeT"; 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 S1344930AbiHOVVr (ORCPT + 99 others); Mon, 15 Aug 2022 17:21:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244827AbiHOVQl (ORCPT ); Mon, 15 Aug 2022 17:16:41 -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 85DB8DEA49; Mon, 15 Aug 2022 12:20:09 -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 8E1F46009B; Mon, 15 Aug 2022 19:20:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99808C433D7; Mon, 15 Aug 2022 19:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591208; bh=GuioARgipAjckdAdajthvc005UG73r+y/SYqcn3+24w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=063c/KeTiRqIUf8a46zzf9I8U6XesB6/F/HomPsMACkqrd2KvRdrRHUxzsnfsXEoT /R+1Xj71bUpIMMWoRrcvOY8FZ8yFvszAZxnSnA5BJuINoS83VjVvnsCcV+YY155iTr TjPLQ0pW6GT8V1jNkY40hux5qHQaVOmg3IHG1Kas= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangyu Hua , Kalle Valo , Sasha Levin Subject: [PATCH 5.18 0507/1095] wifi: libertas: Fix possible refcount leak in if_usb_probe() Date: Mon, 15 Aug 2022 19:58:26 +0200 Message-Id: <20220815180450.503605787@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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: Hangyu Hua [ Upstream commit 6fd57e1d120bf13d4dc6c200a7cf914e6347a316 ] usb_get_dev will be called before lbs_get_firmware_async which means that usb_put_dev need to be called when lbs_get_firmware_async fails. Fixes: ce84bb69f50e ("libertas USB: convert to asynchronous firmware loading") Signed-off-by: Hangyu Hua Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220620092350.39960-1-hbh25y@gmail.com Link: https://lore.kernel.org/r/20220622113402.16969-1-colin.i.king@gmail.com Signed-off-by: Sasha Levin --- drivers/net/wireless/marvell/libertas/if_usb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c index 5d6dc1dd050d..32fdc4150b60 100644 --- a/drivers/net/wireless/marvell/libertas/if_usb.c +++ b/drivers/net/wireless/marvell/libertas/if_usb.c @@ -287,6 +287,7 @@ static int if_usb_probe(struct usb_interface *intf, return 0; err_get_fw: + usb_put_dev(udev); lbs_remove_card(priv); err_add_card: if_usb_reset_device(cardp); -- 2.35.1