Skip to content

Commit

Permalink
usb: musb: debugfs: fix error check
Browse files Browse the repository at this point in the history
debugfs will return NULL on failure, so
we must check for !ptr instead of IS_ERR(ptr).

Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Feb 1, 2012
1 parent e9e8c85 commit 6c2abcd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/usb/musb/musb_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,22 +242,22 @@ int __devinit musb_init_debugfs(struct musb *musb)
int ret;

root = debugfs_create_dir("musb", NULL);
if (IS_ERR(root)) {
ret = PTR_ERR(root);
if (!root) {
ret = -ENOMEM;
goto err0;
}

file = debugfs_create_file("regdump", S_IRUGO, root, musb,
&musb_regdump_fops);
if (IS_ERR(file)) {
ret = PTR_ERR(file);
if (!file) {
ret = -ENOMEM;
goto err1;
}

file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR,
root, musb, &musb_test_mode_fops);
if (IS_ERR(file)) {
ret = PTR_ERR(file);
if (!file) {
ret = -ENOMEM;
goto err1;
}

Expand Down

0 comments on commit 6c2abcd

Please sign in to comment.