Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3081824rwb; Mon, 15 Aug 2022 17:40:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Fj5ZOPnQOTyKyfA2NDhiuKSakz4qN9qX6WLfM1/vxuPN+AspzwRJiInkLFK/1psPbLerM X-Received: by 2002:a05:6a00:2387:b0:52f:17a0:628c with SMTP id f7-20020a056a00238700b0052f17a0628cmr18648423pfc.17.1660610446075; Mon, 15 Aug 2022 17:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610446; cv=none; d=google.com; s=arc-20160816; b=lcl367DeDw0bQpEK/t3ZhSHhCoSc58VOeoBLMMiAfvN2wts0ntwvBw+eLXf2RBxa15 qkwLO6uMLKIMWaYs2mu3L3QEEA7gC2UsUAHPCkLIgFqbN40Vl9H2fV7rLrYtfPhcYXOi VwqAcgSfk+WL30x3KBn0G4/qWZQ4MBvrfTA78IhTou3mVrUodT2pfp03Xu2z/4AjdRpK wDmTWog+w4FgNVG1ueIdJlCzI6dnqFnz0Bj7fHYurTdQA9ZepbVnsakwMY7VM6HQ4t4x qU8z7xgmO4r2zonIAKTNWucg5i0R4KwqhkslB4msmXYD3Y+yZJNBAjbRehXZbr8E7RVq OvMw== 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=LYmL6t5dhDKkxNwmEeuUdSw1mJiMbcIf+DPCuqoClDJCgHppLLjUl5eezE1D9Ueriz CIC19RInblUPt8CJiXBSGdjZmxPMN+a82IWOZEBA9VCgHq1OUL/ULkNN3ogXdaJ3X95J cCQnCOmgeSIXqGUilaw6i76Tx2o+2Yu+Iu+cPaugKGBC6SxrUUEHGyym3aJRUpyhh42j FUc6ZWYCPxyRb9ln/cdBmDpvsINQBvb3wuw5n3mIzO9ddXtXM/lgnykc3vKzOY8r6GXp DovqVUcJJsqJug0Q4mkrGD+mMOb2Qp0Bbd1vKPapM8TH/9FW58psQjRLrbFFtdlIkgnm Mr9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=phXskbN0; 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 k7-20020a170902c40700b001677fa2026asi14223142plk.609.2022.08.15.17.40.34; Mon, 15 Aug 2022 17:40:46 -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=phXskbN0; 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 S1356292AbiHPACN (ORCPT + 99 others); Mon, 15 Aug 2022 20:02:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356405AbiHOXyS (ORCPT ); Mon, 15 Aug 2022 19:54:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 868C916079E; Mon, 15 Aug 2022 13:19:10 -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 69849B81180; Mon, 15 Aug 2022 20:19:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96203C433C1; Mon, 15 Aug 2022 20:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594743; bh=GuioARgipAjckdAdajthvc005UG73r+y/SYqcn3+24w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=phXskbN01fJqbTDmOIJwjCrHXbVWUV1CgXq7tUTN3iFii5bG0dXRs0VVtW3MBsBtd /s/jqkoLjcrzSuzSp9ukZq4fNu5FR86UoP2xL0jLmTGemYCFB54a9Gr8Gi9rpyjQYJ XU+dVYVA0ZjIsem6qCmi0bbzY8aRlbjloXjRcSbU= 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.19 0543/1157] wifi: libertas: Fix possible refcount leak in if_usb_probe() Date: Mon, 15 Aug 2022 19:58:19 +0200 Message-Id: <20220815180501.395329616@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: 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