Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp650131pxb; Tue, 2 Feb 2021 14:21:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpPP7/I3HxnJHr0yOlkNjK9TnFNcZBNDWHPSIrGhw7szJPb4Xx6abzEcLwX92x2fRlUW9G X-Received: by 2002:a05:6402:4312:: with SMTP id m18mr230201edc.99.1612304491534; Tue, 02 Feb 2021 14:21:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612304491; cv=none; d=google.com; s=arc-20160816; b=ka6IlRLogRF/fS/SGWDbjmBNn45RD2hho6o/FWeXXPsC2ofYyvst3fubwa1tpi3Vld F1HhjAfdemvrukfe8hY2hMFakXLzpEAMUXB08om3BA/rtg8PFYdsUwJv/aE1jlfSZpGl qHTwpYj7tgqJvj7Scolf1DgDXanXzvPIohkldKFLM/kzjz+qHswaQvUy+1DQNKYQmwyt ZLalE9SjPC9KxK/3DcRhU+vwYAmmml1ZBkdso/Sw5Mda48X/LPL31sXIWjjy8ZYwb4Sd M3DU6VzmN0zabqL84AcyAK7Rw3FZdomjjtIB8fkckkqFxyDC3R13YVdYzIcw/MNE4sKQ dVRA== 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=2SFEFgYSYP2eZfZu7t05vLJeZt5v2NiySna+0qKixFM=; b=gE5/L5RfJ3+9ziKgkEFKGo29lUPDcu3lpvh3mAJhF2c1iABu/HkTTXrUVtPnmNfwXQ 4Is2tKgTOlHwEqmP/JI9m+Cx20nuSoHP5V1BHcuWtSodBYPMuo/cTVy65djPMkV1hEOC ea41XouTEHXv+c27MJSnnfaN3j2nMoQgCy31Ek0vh8tWahhHVdtzxISio5GArAtxNLLu AoRL8SBU+fzDjjttN/H3eURP2F1OsVWAEgKy85+TBPOrNsU9JdO5P6cl1qEpDk9vxzy5 C9R+9UvL+f83Is8Sg7X7EbDnx974M+TM+BkxEcEJw+tOqqzv3k+TSFq/Sec2hIipRnK1 Hx4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xSdfgSy5; 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 i3si130965ejz.79.2021.02.02.14.21.04; Tue, 02 Feb 2021 14:21:31 -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=xSdfgSy5; 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 S233734AbhBBOMb (ORCPT + 99 others); Tue, 2 Feb 2021 09:12:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:47086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233569AbhBBOHT (ORCPT ); Tue, 2 Feb 2021 09:07:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4CDE765021; Tue, 2 Feb 2021 13:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273784; bh=4Cqo2lL21YMDhklvmCd7KgP83yK7GZh0xMfbHbGn/KU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xSdfgSy52NN3OImsVimpf0FUqaZatKpvZgABh/bzuXbqh8n5IXC3iDQ4R2z4XY+Tt 5aHCt0/LV89dgSPBrdk5ruaXs/8L2BaMvW/1GpgGY/Ngysst9Ue5S89BHLYlDxC5UE XQLjPogTevd9yVdlPx0VmXI1nuWuLz4uPcHdEfAo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , Jakub Kicinski Subject: [PATCH 4.4 28/28] NFC: fix possible resource leak Date: Tue, 2 Feb 2021 14:38:48 +0100 Message-Id: <20210202132942.311729993@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132941.180062901@linuxfoundation.org> References: <20210202132941.180062901@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 commit d8f923c3ab96dbbb4e3c22d1afc1dc1d3b195cd8 upstream. Put the device to avoid resource leak on path that the polling flag is invalid. Fixes: a831b9132065 ("NFC: Do not return EBUSY when stopping a poll that's already stopped") Signed-off-by: Pan Bian Link: https://lore.kernel.org/r/20210121153745.122184-1-bianpan2016@163.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/nfc/netlink.c | 1 + 1 file changed, 1 insertion(+) --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c @@ -850,6 +850,7 @@ static int nfc_genl_stop_poll(struct sk_ if (!dev->polling) { device_unlock(&dev->dev); + nfc_put_device(dev); return -EINVAL; }