linux/drivers/gpu/drm/amd
Dan Carpenter d344b21bf4 drm/amd/amdgpu: Fix debugfs error handling
The error handling is wrong and "ent" could be NULL we when dereference
it to get "ent->d_inode".

The thing is that normally debugfs_create_file() is not supposed to
require (or have) any error handling.  That function does return error
pointers if debugfs is turned off but we know it's enable here.  When
it's enabled, then it returns NULL on error.

So what I did was I stripped out all the error handling except around
the i_size_write().  I could have just used a NULL check instead of an
IS_ERR_OR_NULL() but I figured this was more clear because that way you
don't have to look at the surrounding code to see whether debugfs is
enabled or not.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-10-16 15:10:34 -05:00
..
acp drm/amdgpu: Remove wrapper layer of cgs irq handling 2018-03-21 14:36:58 -05:00
amdgpu drm/amd/amdgpu: Fix debugfs error handling 2018-10-16 15:10:34 -05:00
amdkfd drm/amdkfd: Remove set but not used variable 'preempt_all_queues' 2018-10-10 14:49:42 -05:00
display drm/amd/display: fix bug of accessing invalid memory 2018-10-15 16:17:17 -05:00
include drm/amd/powerplay: added I2C controller configuration 2018-10-16 15:08:54 -05:00
lib drm/amdgpu: add license to Makefiles 2017-12-07 11:51:10 -05:00
powerplay drm/amd/powerplay: update PPtable with DC BTC and Tvr SocLimit fields 2018-10-16 15:09:10 -05:00