Skip to content

Commit

Permalink
audit: don't use simple_strtol() anymore
Browse files Browse the repository at this point in the history
The simple_strtol() function is deprecated, use kstrtol() instead.

Reviewed-by: Richard Guy Briggs <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
pcmoore committed Nov 10, 2017
1 parent be4104a commit 80ab4df
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1567,8 +1567,13 @@ postcore_initcall(audit_init);
/* Process kernel command-line parameter at boot time. audit=0 or audit=1. */
static int __init audit_enable(char *str)
{
audit_default = !!simple_strtol(str, NULL, 0);
if (!audit_default)
long val;

if (kstrtol(str, 0, &val))
panic("audit: invalid 'audit' parameter value (%s)\n", str);
audit_default = (val ? AUDIT_ON : AUDIT_OFF);

if (audit_default == AUDIT_OFF)
audit_initialized = AUDIT_DISABLED;
audit_enabled = audit_default;
audit_ever_enabled = !!audit_enabled;
Expand Down

0 comments on commit 80ab4df

Please sign in to comment.