mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
MIPS: Modify error handling
debugfs_create_file returns NULL on error so an IS_ERR test is incorrect here and a NULL check is required. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; @@ e = debugfs_create_file(...); if( - IS_ERR(e) + !e ) { <+... return - PTR_ERR(e) + -ENOMEM ; ...+> } Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Cc: julia.lawall@lip6.fr Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/13834/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
11f769039e
commit
33799a6d1a
1 changed files with 2 additions and 2 deletions
|
@ -73,8 +73,8 @@ static int __init sc_debugfs_init(void)
|
|||
|
||||
file = debugfs_create_file("prefetch", S_IRUGO | S_IWUSR, dir,
|
||||
NULL, &sc_prefetch_fops);
|
||||
if (IS_ERR(file))
|
||||
return PTR_ERR(file);
|
||||
if (!file)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue