bus:Fix error checking for debugfs_create_dir() in mvebu_mbus_debugfs_init()
PATCH 1/1 bus:Fix error checking for debugfs_create_dir() in mvebu_mbus_debugfs_init()
debugfs_create_dir() does not return NULL,but it is possible to return error pointer. Most incorrect error checks were fixed,but the one in mvebu_mbus_debugfs_init() was forgotten.
Fix the remaining error check.
Signed-off-by Wang Ming <[email protected]>
--- drivers/bus/mvebu-mbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mvebu-mbus.c +1 -1
@@ -993,7 +993,7 @@ static __init int mvebu_mbus_debugfs_init(void)return 0 ; s->debugfs_root =debugfs_create_dir ("mvebu-mbus" ,NULL ); -if (s->debugfs_root) { +if (!IS_ERR (s->debugfs_root)) { s->debugfs_sdram =debugfs_create_file ("sdram" ,S_IRUGO , s->debugfs_root,NULL , &mvebu_sdram_debug_fops);
Signature · 1 line
2.25.1
Quoted 16 lines · Wang Ming
debugfs_create_dir()does not return NULL,but it is possible to return error pointer. Most incorrect error checks were fixed,but the one inmvebu_mbus_debugfs_init()was forgotten.Fix the remaining error check.
Signed-off-by Wang Ming <[email protected]>--- drivers/bus/mvebu-mbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/bus/mvebu-mbus.c +0
-0
drivers/bus/mvebu-mbus.c static __init int mvebu_mbus_debugfs_init(void) · line 996
Quoted 5 lines
drivers/bus/mvebu-mbus.c +1
-1@@ -993,7 +993,7 @@ static __init int mvebu_mbus_debugfs_init(void)return 0 ; s->debugfs_root =debugfs_create_dir ("mvebu-mbus" ,NULL ); -if (s->debugfs_root) { +if (!IS_ERR (s->debugfs_root)) {
No need for this check at all.
thanks,
greg k-h