Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp734726ybe; Wed, 4 Sep 2019 07:02:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrjPNYIcntQ1XV6IVwd0VJ0BHsT/+G9gXOsiZAAEU1zELJ9XZZgodX6i7m1zFItpvJvfxx X-Received: by 2002:a17:902:8644:: with SMTP id y4mr1043066plt.333.1567605779270; Wed, 04 Sep 2019 07:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567605779; cv=none; d=google.com; s=arc-20160816; b=faur5eeB7psQPjWofFL1g1PcD9T3YAWNsPWbNZz7MRuIFeaPBp5qsECwJl3mj1naKH tfHr/gpE+h+xRXI4AVRwqm8krNHRsXnYpEtaWJxzZ2A1cvjvW9Pt4rG9cY3V39/k1EzN NQ9nGQUvlP6JEwmCELpBnrESGaNUqWdWSfvymUTQxR5kxkHFbe64mLSUunLUg4gaVmCN ajiXwk3n80u9zGmkAxWNkFYLiccDEVgO7EbqeGF01h/8Gft3PYfe0n608/NzLLqkJlgK 9hGXbHWhYaA4g/FVylV3ZY9gDVg2nCn0sVuzswdsKoQyxBQ1zhRQFvITJ/s5TVUSLknl ehIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=RhWIO7ycNMh+SZzlY39IQzgW1BrO2fKs0PRssRgEbko=; b=gSclI0RkoHJ8P3NKyN4ut9H7trv+3arRUDMSZgKRGLYwkTJEDNZVGbEHHhEakJlmoY 3GaVk6+NNN0u01OgSiqT554c+c9It8rek0aSmZgoayYvqJLRy95VUbOaQ8x8mz2IwVav iUtc8zI3x3sbg2BwyOS62INpxnxCc/UT7P3Vwh+ShhxDAMvQdPoJwnv+AUnbfBPyzMrY xlGq0lZj6xDeNPCbTxqrDbqre23snmQmiTK6l1Cj6ji7TbYXm/bF32+mM1GDhkrzUIFc XhU417EdfgwYx5DHnfgfhjlxFSgLddNc/SDPHXoc3X7LGcCdafQ7LFZKzCrNT+vUEOWl Uyvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h136si15169501pfe.256.2019.09.04.07.02.42; Wed, 04 Sep 2019 07:02:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731091AbfIDOBN (ORCPT + 99 others); Wed, 4 Sep 2019 10:01:13 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:54924 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730405AbfIDOBK (ORCPT ); Wed, 4 Sep 2019 10:01:10 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 89AB9864175A505DC28B; Wed, 4 Sep 2019 22:01:08 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 22:01:00 +0800 From: Wei Yongjun To: Ben Skeggs , David Airlie , "Daniel Vetter" CC: Wei Yongjun , , , , Subject: [PATCH] drm/nouveau: add missing single_release() Date: Wed, 4 Sep 2019 14:18:57 +0000 Message-ID: <20190904141857.196103-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When using single_open() for opening, single_release() should be used, otherwise there is a memory leak. This is detected by Coccinelle semantic patch. Fixes: 6e9fc177399f ("drm/nouveau/debugfs: add copy of sysfs pstate interface ported to debugfs") Signed-off-by: Wei Yongjun --- 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 7dfbbbc1beea..35695f493271 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -202,6 +202,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[] = {