Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1619557pxb; Mon, 11 Oct 2021 09:36:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+IFxNxd19dLsNIkLSU0zhJTbX4sbhepyy0kf7jfO2zzogMg2aAxiUg/88xEku8olQzJUS X-Received: by 2002:a17:906:3ac6:: with SMTP id z6mr9485069ejd.196.1633970193028; Mon, 11 Oct 2021 09:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633970193; cv=none; d=google.com; s=arc-20160816; b=IjwDDxr+6V69B+tzJc80NdgTujqLKEWmaqtmrEOwVven86rVxrXdvNXDh6lwIt/5L2 mx3S16893A5zYtPqM1m1QAhJnPz2BcN1EIJWCpDyNBVGQNj6Kl/9zXTSN3ZIRHE4wjtv 7720GzHaJv8MUtLiDo6ppaHM4zAQhbA9Y4vrV+sxmrJopZp7xbbzQUugUwPQWbOoC7Kw zLdFA8ITnwnC3lnhMg0sfl6pnIKkgy337r2jYCx0Ie/0RQWRHdIUlmnOriJ7uW1UaU1H kwTcWLQ41kqB805ceuBQTliwc5HgDmgLnHFJ4nK960o5tpGj3ATunYSKYUqopQVaSDlA jVVA== 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=dGWIdVQsuQNxZoy24YD4tc65SEls7rSNjOIGyUnYePc=; b=VVqd+62y4nCkV0MpYtJLBxWaPiuxbPoP/CsnfNBhGPyynAsg+/YAVHsoC0gxDmVZJO 7irvWLRZEGXQFYdMh3dOpL8O6Dq42On6Y2JHRnO6wY3njLExu/03ftFXRJmw0u2WCQRQ g/eS227r4o9TnEspKRXL/XxHE2G7AymKcyVnQQrHVlWgyWtgmI2v96f+b5FjBk5XuIGC K16mNRZ+Ho7ovn05aAvWCaPHY6qAccZKAEsPSUGoHHSFqQ8IrQKnZ/hNDaUK7QPBM4tB Sgopoakq0Slos87GgVXNAbf1HvNa/RYih632UuUW0r80EX77XD0e01rWXqQg3x1zP04F /+RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pJkMrkAe; 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 z4si2756979ejw.190.2021.10.11.09.36.09; Mon, 11 Oct 2021 09:36:33 -0700 (PDT) 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=pJkMrkAe; 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 S241530AbhJKOMG (ORCPT + 99 others); Mon, 11 Oct 2021 10:12:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:57344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242222AbhJKOIv (ORCPT ); Mon, 11 Oct 2021 10:08:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6BBBD6124B; Mon, 11 Oct 2021 14:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960895; bh=7uHLBaU7MVfBona6fKXUSESifdH1LisxkGZrXLyXGUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pJkMrkAe6Lv3QAyosWkXFJeElVbrnys6320RnDWuTafgxo44WzE210RxrGd1k7+sK lVe/Ags2xR9Oak4586IcqC25bOe5dkf25qZ9HKZcW8nwbdXeP9UQFPZXGAjXiZ7dQR pkASikYniL+wE8rMXayR0VMY0hleWcBNLEs816Qs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , Karol Herbst , Maarten Lankhorst , Sasha Levin Subject: [PATCH 5.14 105/151] drm/nouveau/debugfs: fix file release memory leak Date: Mon, 11 Oct 2021 15:46:17 +0200 Message-Id: <20211011134521.212763243@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134517.833565002@linuxfoundation.org> References: <20211011134517.833565002@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: Yang Yingliang [ Upstream commit f5a8703a9c418c6fc54eb772712dfe7641e3991c ] When using single_open() for opening, single_release() should be called, otherwise the 'op' allocated in single_open() will be leaked. Fixes: 6e9fc177399f ("drm/nouveau/debugfs: add copy of sysfs pstate interface ported to debugfs") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20210911075023.3969054-2-yangyingliang@huawei.com Signed-off-by: Maarten Lankhorst Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index c2bc05eb2e54..1cbe01048b93 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -207,6 +207,7 @@ static const struct file_operations nouveau_pstate_fops = { .open = nouveau_debugfs_pstate_open, .read = seq_read, .write = nouveau_debugfs_pstate_set, + .release = single_release, }; static struct drm_info_list nouveau_debugfs_list[] = { -- 2.33.0