public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/amdgpu: potential NULL dereference on error
@ 2015-06-11  8:49 Dan Carpenter
  2015-06-11 12:03 ` walter harms
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2015-06-11  8:49 UTC (permalink / raw)
  To: David Airlie
  Cc: Alex Deucher, Christian König, Jammy Zhou, yanyang1,
	Marek Olšák, dri-devel, kernel-janitors

debugfs_create_file() can return an error pointer if debugfs is disabled
or it can return NULL on error.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 36be03c..adba2a1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1980,6 +1980,8 @@ static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)
 				  adev, &amdgpu_debugfs_regs_fops);
 	if (IS_ERR(ent))
 		return PTR_ERR(ent);
+	if (!ent)
+		return -ENOMEM;
 	i_size_write(ent->d_inode, adev->rmmio_size);
 	adev->debugfs_regs = ent;
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-11 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-11  8:49 [patch] drm/amdgpu: potential NULL dereference on error Dan Carpenter
2015-06-11 12:03 ` walter harms
2015-06-11 12:20   ` Dan Carpenter
2015-06-11 14:35     ` walter harms
2015-06-11 14:51       ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox