Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1446378

[PATCH -next] drm/amdgpu: fix return value check in amdgpu_debugfs_ring_init()

From Wei Yongjun <weiyj_lk@163.com>
Newsgroups linux.kernel
Subject [PATCH -next] drm/amdgpu: fix return value check in amdgpu_debugfs_ring_init()
Date 2016-07-19 14:20 +0200
Message-ID <rWCae-3Tc-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function debugfs_create_*() returns NULL
pointer not ERR_PTR() if debugfs is enabled. The IS_ERR() test
in the return value check should be replaced with NULL test.
(defined(CONFIG_DEBUG_FS) make sure debugfs is enabled)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 3b885e3..9247ae16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -362,8 +362,8 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
 	ent = debugfs_create_file(name,
 				  S_IFREG | S_IRUGO, root,
 				  ring, &amdgpu_debugfs_ring_fops);
-	if (IS_ERR(ent))
-		return PTR_ERR(ent);
+	if (!ent)
+		return -ENOMEM;
 
 	i_size_write(ent->d_inode, ring->ring_size + 12);
 	ring->ent = ent;

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH -next] drm/amdgpu: fix return value check in amdgpu_debugfs_ring_init() Wei Yongjun <weiyj_lk@163.com> - 2016-07-19 14:20 +0200

csiph-web