Received: by 2002:a05:6520:1682:b0:147:d1a0:b502 with SMTP id ck2csp5595850lkb; Mon, 11 Oct 2021 09:38:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh8yj3vA+LT4jomgf1n2WG7vjBtF9F2ELFiwsHHYT1N77bEWl6gq+hZM04h6Jp7VYQJw92 X-Received: by 2002:a17:906:a08a:: with SMTP id q10mr26657103ejy.100.1633970291007; Mon, 11 Oct 2021 09:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633970290; cv=none; d=google.com; s=arc-20160816; b=fOryXmWg7c3oT/5fXWyh26QNFOaHVNJUhJ+m5/i+KSlSerKNuY1TQ8tMhsLt2bewVA fJJFDdkNcdj6aWxL1IUKM1mg7E1B8FauJP38/PkI5CDpvKqvc3JQ1ctixk1hrwTm2T5y 4YtL9B341hmTOBd9ovJT8u1EIcrQYfFyZ7YyMU06lzrQMvNYG5zXIGywjsT0qzJfeZB9 0n43FLeM0Ccw/Q1lPtHpMApFqMLW/UzZfr5QNehpkahgSQidJSSnP8pd7qetzOU2961x miIPQlh59U6IfPecK0k/TKm2fYmAr0tmW8rK13moKCu8w8zzpipFGS0w5M+6aXUyoZod GadA== 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=BKtapsixN+NPnOS4qEP9ej7+DCUQUmAZGvQ7sNg7E8M=; b=JZmkvMgjZdSXJsyF0HAKpxoLNoBHsq/yJ5RQXXjcJzLz8VqvI7z+UWRFvcbay4BzoV EMynceCRUWF/TvuKJsPnkVV0DpX5RHf0COtkIOXv7KMP4tq5TE7gxg15whuLf0GifsLB XhB7+oJYYM0LiJAT6NPyyEWa1NFZqEd3zceIr2AxM+mzPbpSK/9QaGEX2OHvkg4roIsR 6nbSoaB84QFnqxhqs+2FAJQEm2XodC3CHCM7ao7sgkEr98lfW7IEDSiz7r1tE6Ski8k+ FkjmDawarG4J1ldk9FvM/4IgyqmArY6d1+FgFaKUia4tMT5N+Frc5QeaF2etJggwjZr4 Hcsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U6i+TY1b; 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 rp18si11680838ejb.316.2021.10.11.09.37.46; Mon, 11 Oct 2021 09:38:10 -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=U6i+TY1b; 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 S244153AbhJKOSH (ORCPT + 99 others); Mon, 11 Oct 2021 10:18:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:38724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244189AbhJKOPY (ORCPT ); Mon, 11 Oct 2021 10:15:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6699661359; Mon, 11 Oct 2021 14:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633961119; bh=ypwFQT/ttAArZs0XkrtyKy2gElvMXG7xS2Yrt+rUiZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U6i+TY1b9ToN/r/Y211X8xoj7yIFxpPi2/k85lWwdubwHq7f4RAP8FafBaRBNMUJV nsDKnvgrDd52Tgrd6KbhuSq7QWj+ZFiUD7aIok2R4gXfegjubRSlAlhHoruW3pliFH GTxCBwjhmIChK2Q0SGkOjnI8MwFVZ/iMpurdIwy4= 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 4.19 22/28] drm/nouveau/debugfs: fix file release memory leak Date: Mon, 11 Oct 2021 15:47:12 +0200 Message-Id: <20211011134641.427478874@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134640.711218469@linuxfoundation.org> References: <20211011134640.711218469@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 4561a786fab0..cce4833a6083 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -185,6 +185,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