Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp383360pxb; Wed, 3 Mar 2021 05:51:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwr4oxmrob+hfboNdIgox2ZEvpJZSDUrHLANfRDsmLUuY4wvfjcRhS+/BA6W8KVz+FfnecA X-Received: by 2002:a05:6402:1855:: with SMTP id v21mr25435762edy.310.1614779504762; Wed, 03 Mar 2021 05:51:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614779504; cv=none; d=google.com; s=arc-20160816; b=d1SHmzdJ8PIAtZIsVCvMxV+8hVdhv8j6FzLgrs9fIRO+aIn6BHPqRBjjQ4UNxa1RLw XaHIv2Ds6vksz2X9F+LNlDoefIdKSS+TOzOspi6EUXw2HKFluGKcOmzEs0hFFqHO33Rs INtYHkJoFvHbS3u/a0ohEzTzBJ/gKk9pujBQdel17ax7EfkBBcynLmnO4IvtH4yORBwn DWteu+w4FWvdxAZW1oPeePcf6wMX1c8c8IgjUsrl2/LTkyv09GxjUxEhGsnPYEbFlEdg g9Bpj170/Tr6YpMOVNBlTmRmdIPxiKM4poEEV6pCDX+e8Tb72BODYsu7PrEbcjg3JRhn 3A4w== 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=E8L8APXX3XuYpza1S3k3ubBjvqz79cGqiSPf2ZtNw6A=; b=hg5lf0e6k4n3OHjMEPHjPoIMiLn1Q6zhyIyDI9Ft4tZZ+/gRwK80pt53WFD3tmBNTF 9uWub84nCc/GDGWjwQvXHhC51IuvwHPSsMLevjZF2/gzDdlTtZiFEXWH176gETZJXjWa 9yxkuazIjzwNLvKKyHUhp1tjo21S5pC1O/F31tnENo8q4fy+lCZ3diA232jw7GJCvWuv ykzSb9SYIataKcddLSkolcgJCNoLEMn2Mqwcmv/1uuzjAmLKQCqLNHROkEtCi1Eez7wo YjdXNf321XhuYPg+K675HTcxsWCY/uL3yTEUEeWSyDm2gxJj6J2ouX29gPhRP1pidA46 67KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ee7qIv0P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r6si2969789eda.292.2021.03.03.05.50.44; Wed, 03 Mar 2021 05:51:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ee7qIv0P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S242562AbhCAUCz (ORCPT + 99 others); Mon, 1 Mar 2021 15:02:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:55954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236292AbhCAQ6s (ORCPT ); Mon, 1 Mar 2021 11:58:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 53F8D64FE1; Mon, 1 Mar 2021 16:37:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616635; bh=2VnzAFN/fq4biR6xgtsn2hnLhJh6Ar0+Mlqs/05rGMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ee7qIv0PbK+VE1QYXPZphDsLrJkKHJBCmcVzM0W+mocY9uUzOb5JZy/OuyfPgVsZ6 sqYhRXsiO8vJGU7YVXVSA7G5LJr5TcVi3JVv37fF4037NdFCVANzeCpcO90HFLyyWL k+FDIpGH+mlnOORoylR5unIHNF/k78PVaQAb4gAU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.19 043/247] Bluetooth: drop HCI device reference before return Date: Mon, 1 Mar 2021 17:11:03 +0100 Message-Id: <20210301161033.779049039@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pan Bian [ Upstream commit 5a3ef03afe7e12982dc3b978f4c5077c907f7501 ] Call hci_dev_put() to decrement reference count of HCI device hdev if fails to duplicate memory. Fixes: 0b26ab9dce74 ("Bluetooth: AMP: Handle Accept phylink command status evt") Signed-off-by: Pan Bian Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/a2mp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index 888813342cfc8..e09ea78356c36 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c @@ -519,6 +519,7 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb, assoc = kmemdup(req->amp_assoc, assoc_len, GFP_KERNEL); if (!assoc) { amp_ctrl_put(ctrl); + hci_dev_put(hdev); return -ENOMEM; } -- 2.27.0