@@ -317,8 +317,8 @@ static int proc_dobitmasks(struct ctl_table *table, int write,
}
} else {
tmpstr = memdup_user_nul(buffer, nob);
- if (!tmpstr)
- return -ENOMEM;
+ if (IS_ERR(tmpstr))
+ return PTR_ERR(tmpstr);
rc = libcfs_debug_str2mask(mask, strim(tmpstr), is_subsys);
/* Always print LBUG/LASSERT to console, so keep this mask */
@@ -942,8 +942,8 @@ int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob)
int rc;
str = memdup_user_nul(usr_str, usr_str_nob);
- if (!str)
- return -ENOMEM;
+ if (IS_ERR(str))
+ return PTR_ERR(str);
path = strim(str);
if (path[0] != '/')
@@ -1001,8 +1001,8 @@ int cfs_trace_daemon_command_usrstr(void __user *usr_str, int usr_str_nob)
int rc;
str = memdup_user_nul(usr_str, usr_str_nob);
- if (!str)
- return -ENOMEM;
+ if (IS_ERR(str))
+ return PTR_ERR(str);
rc = cfs_trace_daemon_command(str);
kfree(str);
@@ -816,8 +816,8 @@ static int proc_lnet_portal_rotor(struct ctl_table *table, int write,
}
buf = memdup_user_nul(buffer, nob);
- if (!buf)
- return -ENOMEM;
+ if (IS_ERR(buf))
+ return PTR_ERR(buf);
tmp = strim(buf);