From: Felipe Balbi Date: Tue, 31 Jan 2012 12:19:00 +0000 (+0200) Subject: usb: musb: debugfs: fix error check X-Git-Tag: MMI-PSA29.97-13-9~17266^2~22^2~41^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6c2abcdd4f8e21ce686a26697de0ce198a16eaed;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git usb: musb: debugfs: fix error check debugfs will return NULL on failure, so we must check for !ptr instead of IS_ERR(ptr). Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c index 219d0fba584e..40a37c91cc10 100644 --- a/drivers/usb/musb/musb_debugfs.c +++ b/drivers/usb/musb/musb_debugfs.c @@ -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; }