Skip to content

Commit

Permalink
HSI: omap_ssi: Fix return value check in ssi_debug_add_ctrl()
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
  • Loading branch information
Wei Yongjun authored and Sebastian Reichel committed Jul 30, 2014
1 parent c2acb7c commit 3fd276e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/hsi/controllers/omap_ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,22 @@ static int __init ssi_debug_add_ctrl(struct hsi_controller *ssi)

/* SSI controller */
omap_ssi->dir = debugfs_create_dir(dev_name(&ssi->device), NULL);
if (IS_ERR(omap_ssi->dir))
return PTR_ERR(omap_ssi->dir);
if (!omap_ssi->dir)
return -ENOMEM;

debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi,
&ssi_regs_fops);
/* SSI GDD (DMA) */
dir = debugfs_create_dir("gdd", omap_ssi->dir);
if (IS_ERR(dir))
if (!dir)
goto rback;
debugfs_create_file("regs", S_IRUGO, dir, ssi, &ssi_gdd_regs_fops);

return 0;
rback:
debugfs_remove_recursive(omap_ssi->dir);

return PTR_ERR(dir);
return -ENOMEM;
}

static void ssi_debug_remove_ctrl(struct hsi_controller *ssi)
Expand Down

0 comments on commit 3fd276e

Please sign in to comment.