Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp698793ybe; Thu, 5 Sep 2019 04:41:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEIUPQ4DfYkJD/UV8FUm4ixxvuS3QDaniYbvENElzeDavaa2ZspkH4+SGJAtv2VfVnyB9b X-Received: by 2002:a17:902:ba95:: with SMTP id k21mr2997181pls.80.1567683660828; Thu, 05 Sep 2019 04:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567683660; cv=none; d=google.com; s=arc-20160816; b=gN2KYHEbsr6bPaqbjHtbWEZppf65piqVfpViZwDhzEF6c/KoEc1OvU+JIj1PGui49q 56I/9m82j360n+rQXU1RFXB7H36ri6AS7dGc4eNNhVOzYjeI8N3100+y4alDScOFaTWE nEvfVsBzplgtxMXSPePtyIgnxjXi/h3gNIAkNVZ2yyiFAPVUSlpwN2DVCmRx/7jNugfy eeiCbkLm6ZmduNTHKDkPXpD+h7RVq647wDKV9X1gsGUyMgpv3BMMmpdTrn2XVK1D4CBH P7ZPRFlLlEque8PXRShHTsPyUDMOHoPqAHjLf3Ch6LL2cdy4wjiACJ+OGXwL043agVI+ 1YmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=8YgkTckHnd+oBCtkJ3PeDRAfoIVwhj7X9BQME1lU8Rk=; b=AzRuBdg0QIki2HN6pGHycn52qOpppG1hc4Tf6vyC/pxMExuI/pcYQo1EQsyTclxW2L PGGio6GDETGhnqcC6bpbWzAFYSePcGqKtjHUKGs0qCQy/nXVMbHRYgRMN5RD4DsCrlye ir6TMnj3gqgEbEnkX3M0OGk7ZGP1ZM71zbQMcIECc0Bt/fvAN3/gVFpr0Uzo+rGfwygb RCSlM70ssJnEVWPtZsWektiaGNVHNJTXBp/AnrClxqz6vB8EpxavyZbwispVfj0Cc6Oq rAXO9MBajwU2NmvlFOyJwGuitgtsEUo5Fza0DsFOW9ylTcEkE7U4KbLZyzyIkOUDaTTy H5wA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si1820855pln.193.2019.09.05.04.40.44; Thu, 05 Sep 2019 04:41:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733071AbfIEJME (ORCPT + 99 others); Thu, 5 Sep 2019 05:12:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42202 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733051AbfIEJMB (ORCPT ); Thu, 5 Sep 2019 05:12:01 -0400 Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E487E882EA for ; Thu, 5 Sep 2019 09:12:00 +0000 (UTC) Received: by mail-io1-f69.google.com with SMTP id a20so2348497iok.21 for ; Thu, 05 Sep 2019 02:12:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8YgkTckHnd+oBCtkJ3PeDRAfoIVwhj7X9BQME1lU8Rk=; b=EvpaixDuxt7HJLf5hgXI6SCr7Q58EKBJI6zrHan+DeRTXVEvbbqFeJJZ6aOINCxF8t 0LIAuhOeSP9do4Zq68MWCR8X8CzkYWVh4Qezj3zzT5hsDjqO9nQlKauvVhbCZV2VmJyi RhS8JP4T8wEOPDJAQieGfKQ4Cu4qTufqSeacpe+OpvLxohS4YNWQtBIr5CNMbhfrzNhR K6CGgKv1BXPEKmp4EcgrtXJV4eoAQhXuOBqG7NY8n3WRBeBoqsEBdhoAl1f72yYpWaaT HH0wli91IdxMrF9v1zVTddyYtkJ/ziSf+ue5YXkBvscCW5ccfU0M9GX7YU+EYbH6ep58 u4OA== X-Gm-Message-State: APjAAAUsYOv54NzS8JaH+lilwVspVzkpzxlyWljGtqGPkTuJsSfgTCIV m4YlNIWmUZZgqo3FIuouiTd93o3/H5CDj/SZQLjUxjB2V8T93tW8ve6JuOkS2eHhMEAB3zPFRfw D9BSXOQShJt5v20BZDYl+qRr4PB5A+v1H12uFMkTy X-Received: by 2002:a5e:9509:: with SMTP id r9mr2974892ioj.100.1567674720332; Thu, 05 Sep 2019 02:12:00 -0700 (PDT) X-Received: by 2002:a5e:9509:: with SMTP id r9mr2974868ioj.100.1567674720115; Thu, 05 Sep 2019 02:12:00 -0700 (PDT) MIME-Version: 1.0 References: <20190904141857.196103-1-weiyongjun1@huawei.com> In-Reply-To: <20190904141857.196103-1-weiyongjun1@huawei.com> From: Karol Herbst Date: Thu, 5 Sep 2019 11:11:49 +0200 Message-ID: Subject: Re: [PATCH] drm/nouveau: add missing single_release() To: Wei Yongjun Cc: Ben Skeggs , David Airlie , Daniel Vetter , nouveau , kernel-janitors@vger.kernel.org, LKML , dri-devel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Karol Herbst On Thu, Sep 5, 2019 at 9:14 AM Wei Yongjun wrote: > > 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[] = { > > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel