Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp648308pxb; Tue, 2 Feb 2021 14:18:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyNmLdwExAk61sinjK0v8lMGASkIHhd9t/FXrnSWTrh+qXNQ3iqXno1CFZNZigFn5k/Q7p X-Received: by 2002:a17:906:c34d:: with SMTP id ci13mr125580ejb.333.1612304295302; Tue, 02 Feb 2021 14:18:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612304295; cv=none; d=google.com; s=arc-20160816; b=wRdCVMj2+jHojhfHbQrNrSootB/W6Ufuwqkg12eAZQRnMJmsMA9CFX1lOo5L7S7MHD 0Eqbg+RyNc0jzKmC4gmwb4V6X0u4L2NdiAK5aVarhu1ApphhplA6JU7Z+QMrGBQDpjGx 8YSEhvzjm0N6GznZwTLewpDPJX8YZWCRASHSGHeuFXiWfccdEQQEaRbrV1KQ0ejw4uYG wSwucBqAoo6x5U16y+FFCJxf8qg5HTx/Q+sghmWHxp4CdyA6NOt6q1ooxL3ZHu+2gSr5 JEo1y9Z90E6fEVnwdhx53INBP1nNAkARwuX+ppfQAcAtNC3BjShtAab8LMv+TvCtdbW9 efiA== 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=2J+zDmWPzZJ3kXGMBPhwtnZI+zkt1AUEzGz8NzjaUcg=; b=Ux+BDbWeoLWYjpzBjWusUc8jTGqrBbmqqEEeDozFC6ssl4KkMsAfAOb32aQM8kIzbj GJpzKiYy6g274acpjlLZVkVE8LWYn1Cxg1/Ev9aZ125LzHc9Dk8p59tlJ1npQua9WCEu 6bADheuN0MqsvMAEA5K6S+48HCm6YJC3J/FCvx83YZmAiwGV+jp72LNcZFLzmKB+lrD9 tFmJRl9C2tuwJ/i25j9dwi5PyVk3+X9b8C96H61jsaV7EXSFxJeWabQhrTxjyHm97YxY 1ztTQYr/c1zgeDBafUDurz4BYCGy3pSRxM4ZmLf0JXamdNDqHw+Xj9OladPUFq1MWjzW /WVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IZLtCZHQ; 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 z23si54260edr.175.2021.02.02.14.17.50; Tue, 02 Feb 2021 14:18:15 -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=IZLtCZHQ; 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 S233169AbhBBOCX (ORCPT + 99 others); Tue, 2 Feb 2021 09:02:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:45374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233370AbhBBN4n (ORCPT ); Tue, 2 Feb 2021 08:56:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E099C64F66; Tue, 2 Feb 2021 13:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273513; bh=y6ATv8G0zfuUfFNJiOSTF7sPrAFuRP9P5nN4ff341N4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IZLtCZHQ9fDPrvU4ivH1FYJPOJe8VvlMs8FJUfBk2741Bjlqq+V6X/u6bzdyzsq0+ SkWXiLRoT5eTPI3ASVXX5kxNHAq2JISdzPBJtyC8Jzyh3XFxPvIH7F98v0b0BhwbKT UiuvcmfPoSb79jpizonsYvSvYg058MEsqQYx/iOU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , Jakub Kicinski Subject: [PATCH 5.10 134/142] NFC: fix possible resource leak Date: Tue, 2 Feb 2021 14:38:17 +0100 Message-Id: <20210202133003.221795071@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@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 @@ -852,6 +852,7 @@ static int nfc_genl_stop_poll(struct sk_ if (!dev->polling) { device_unlock(&dev->dev); + nfc_put_device(dev); return -EINVAL; }