Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751993AbcLEUdK (ORCPT ); Mon, 5 Dec 2016 15:33:10 -0500 Received: from mail-sn1nam01on0056.outbound.protection.outlook.com ([104.47.32.56]:64566 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751501AbcLEUdI (ORCPT ); Mon, 5 Dec 2016 15:33:08 -0500 From: "Deucher, Alexander" To: "'Nicolai Stange'" , Daniel Vetter CC: "Koenig, Christian" , =?iso-8859-1?Q?Michel_D=E4nzer?= , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" Subject: RE: [PATCH] drm/amdgpu: don't add files at control minor debugfs directory Thread-Topic: [PATCH] drm/amdgpu: don't add files at control minor debugfs directory Thread-Index: AQHSTzZylIO76pEKKkeCV7oTpXaUGaD5zqyA Date: Mon, 5 Dec 2016 20:33:05 +0000 Message-ID: References: <20161205203022.11671-1-nicstange@gmail.com> In-Reply-To: <20161205203022.11671-1-nicstange@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Deucher@amd.com; x-originating-ip: [208.255.205.5] x-microsoft-exchange-diagnostics: 1;MWHPR12MB1311;7:p1Hqdo5R2yC8CdzJXVbslvyaALiwSajcuSkVWDxpT7O51ndQFge7ATvNLy6oaIY1YRrzsz4d0nB9wtckwRUzfgpe4ujnWmDOECQDfXLGiyLZpWBptDg8F9RspX9BCl7VgN+e6kXb8+iD2GtPtRHgl5h9yX9MgrGl7R4vR11G46poWjvHyLBCIhMZRqKotCDLqDSD/MyiB60LL5kUeDZiQoBQL7w3Bg2FZ2zahOfYSxVgPKKnNXLoDNUNZovmXJ9h2hwN77pP+SXgKjrsrYcKQqiqGc5BcGRgAa6r8fTkjGX8m6Hz3apOf6+S6llMCpxU2lj1ebeDVtSPnG1kPdlhG6Vt2i9iRf2NB/dMifaAtBt1kC28idlxtQt8JKUmhKwnxFBdBhL74T8BH6xU6dKk7mw9EAIEYXGTJbwMmDIoJME9ZoTkYktGMmyWfFs7TQaxQSjtN7XQFXC50qDXk8D3LA==;20:6huicBuDAFxkzfH+LqygATRPZH2zd75blHkUwDSx1H8wKu+TLFrLpdeKcRNu9qCqPGO7zBqgkl1hUkHhiiQZWk5d7KMw2tqnp/Ev9acnnNYR/CHZkgE3v8g09cL0Xhhy+9C5//Fw+nNm64jKuoVarQTIfJWJLzpAcw4I+ReFOkGdQEVyvgCLmwZEzzDzR1s4+9b3R2TH+/uybICiMHynYv/TxmT3U5L+iaVz84l7wv2tnC4Hz3h7wS2SIavoTcZ0 x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(13464003)(199003)(377454003)(86362001)(6506006)(66066001)(102836003)(6116002)(189998001)(97736004)(9686002)(5001770100001)(76176999)(8936002)(5660300001)(39840400001)(122556002)(39860400001)(2906002)(81166006)(81156014)(305945005)(7696004)(2950100002)(101416001)(68736007)(8676002)(54356999)(4326007)(3846002)(50986999)(7736002)(3280700002)(77096006)(39410400001)(38730400001)(39060400001)(39450400002)(3660700001)(2900100001)(105586002)(99286002)(229853002)(92566002)(74316002)(106116001)(76576001)(39850400001)(106356001)(33656002)(7846002);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR12MB1311;H:MWHPR12MB1694.namprd12.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: 465cc458-8516-492a-0905-08d41d4deb34 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR12MB1311; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(767451399110)(217544274631240); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(6072148);SRVR:MWHPR12MB1311;BCL:0;PCL:0;RULEID:;SRVR:MWHPR12MB1311; x-forefront-prvs: 0147E151B5 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2016 20:33:05.9213 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1311 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uB5KXNXH028387 Content-Length: 2235 Lines: 63 > -----Original Message----- > From: Nicolai Stange [mailto:nicstange@gmail.com] > Sent: Monday, December 05, 2016 3:30 PM > To: Daniel Vetter > Cc: Deucher, Alexander; Koenig, Christian; Michel D?nzer; linux- > kernel@vger.kernel.org; dri-devel@lists.freedesktop.org; Nicolai Stange > Subject: [PATCH] drm/amdgpu: don't add files at control minor debugfs > directory > > Since commit 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"), a > struct drm_device's ->control member is always NULL. > > In the case of CONFIG_DEBUG_FS=y, amdgpu_debugfs_add_files() accesses > ->control->debugfs_root though. This results in a NULL pointer > dereference. > > Fix this by omitting the drm_debugfs_create_files() call for the > control minor debugfs directory which is now non-existent anyway. > > Fixes: 8a357d10043c ("drm: Nerf DRM_CONTROL nodes") > Signed-off-by: Nicolai Stange Please add the bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98915 With that, Reviewed-by: Alex Deucher > --- > Applicable to next-20161202. Compile-only tested. > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index deee2db..0cb3e82 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -2493,9 +2493,6 @@ int amdgpu_debugfs_add_files(struct > amdgpu_device *adev, > adev->debugfs_count = i; > #if defined(CONFIG_DEBUG_FS) > drm_debugfs_create_files(files, nfiles, > - adev->ddev->control->debugfs_root, > - adev->ddev->control); > - drm_debugfs_create_files(files, nfiles, > adev->ddev->primary->debugfs_root, > adev->ddev->primary); > #endif > @@ -2510,9 +2507,6 @@ static void amdgpu_debugfs_remove_files(struct > amdgpu_device *adev) > for (i = 0; i < adev->debugfs_count; i++) { > drm_debugfs_remove_files(adev->debugfs[i].files, > adev->debugfs[i].num_files, > - adev->ddev->control); > - drm_debugfs_remove_files(adev->debugfs[i].files, > - adev->debugfs[i].num_files, > adev->ddev->primary); > } > #endif > -- > 2.10.2