[lkml]   [2019]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 6/6] dma: qcom: hidma: no need to check return value of debugfs_create functions
On 6/12/2019 11:39 AM, Greg Kroah-Hartman wrote:
>> Interesting. Wouldn't debugfs_create_file() blow up if dir is NULL
>> for some reason?
> It will create a file in the root of debugfs. But how will that happen?
> debugfs_create_dir() can not return NULL.

I see.

>> + debugfs_create_file("stats", S_IRUGO, dir, chan,
>> + &hidma_chan_fops);
>> Note that code ignores the return value of hidma_debug_init();
>> It was just trying to do clean up on debugfs failure by calling
>> debugfs_remove_recursive(dmadev->debugfs);
> Is that a problem?

I just wanted to double check. You probably want to remove the return
value on debugfs_create_file() to prevent others from doing the same

Acked-by: Sinan Kaya <>

 \ /
  Last update: 2019-06-12 18:18    [W:0.035 / U:19.356 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site