Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1615093pxb; Mon, 11 Oct 2021 09:31:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPZwvcNAgfZ8ycnJAQjKeQL8KxLNGNLKbOCVJc9sU5sXpH3LePIYKWKaF+Hn1ppFJrHMJ9 X-Received: by 2002:a17:902:ba8e:b0:13e:c690:5acb with SMTP id k14-20020a170902ba8e00b0013ec6905acbmr25671051pls.63.1633969914992; Mon, 11 Oct 2021 09:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969914; cv=none; d=google.com; s=arc-20160816; b=fcfqcY/yA7UQP2WvI1nOdDjySO2sTGMwScnY5F/C/wo6Aagf3sWYC1iUfYLP+NCsbL ZT4gS85+0Yk2ashND+pvMbm2KyakvEL8hkR8wyFM3yCmvbmqLgldOKoXRobpic3J5CWv 45PN2Ctkh0nVXXfAAVxL8Viz6bNiI74D8pIjTUJr2iu+37wjBDKnAmCMpjlDSjnKa2bS L5f/V5pCcorgBLg0ABH5E5pSWwZ3YTTH7fKfXEvnm0Gbcv+UHcxH+mSV0zXyw1qvxL2N T+5GhKezaV7+i3VFPlGVKvTrdwrq63y3FLjc5AY+QIQjugEI4458s6MeAI2u85WxqJtd R6YQ== 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=Nd+kd4+TVS3OxH1urqDc0IJsws6Zjp6ho28auVv8hL6G+KftzAeFiYO31QA57xb09P VHfs+Nd29iosqSIR1d6uSkrUJeSiPdGdBY4Gpieyvk82WA9EKYFkxg7GZlYDuIoZHZKh 0vlAPjr/GWFQyWS56sNaJBD1bAjbsX8MkZ0lQAwbElde2td0XtnVUOmYDeEPUW4XBs8G tVvq+Yg8sLg1KrOsQFbcdaK+CY7LLVllPYKar6TXg44alRPnylBLL9DBkVO7j/RAgiag x+YHB+OiLYKG/T6N1iw9s9b8GTSXr3narM/ZBjXwtgUoKOSn42jdc8aFW7Py+nDWIXqS lPaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="yf2aBSV/"; 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 l193si10787884pge.180.2021.10.11.09.31.42; Mon, 11 Oct 2021 09:31:54 -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="yf2aBSV/"; 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 S237943AbhJKN7k (ORCPT + 99 others); Mon, 11 Oct 2021 09:59:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:40826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231538AbhJKN5E (ORCPT ); Mon, 11 Oct 2021 09:57:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B364E61076; Mon, 11 Oct 2021 13:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960432; bh=7uHLBaU7MVfBona6fKXUSESifdH1LisxkGZrXLyXGUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yf2aBSV/H9ueMlXBEw4HnQ+Kw6YfDCsLskn+JewsMwiy5SVgVF7VJxdXVG1Dnhqzt 2YxcyarNzlSVt1eVhNmch6U5gnzDaa0pHkoYlbG/V3ZMRGADbLFxp3iulczKH4zOcd Ouxsyz4JEFdDFyMW/2CTlDs4OROQn1Sw9fRjXoOc= 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.10 58/83] drm/nouveau/debugfs: fix file release memory leak Date: Mon, 11 Oct 2021 15:46:18 +0200 Message-Id: <20211011134510.391146023@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@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