Skip to content

Commit 80ab4df

Browse files
committed
audit: don't use simple_strtol() anymore
The simple_strtol() function is deprecated, use kstrtol() instead. Reviewed-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent be4104a commit 80ab4df

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎kernel/audit.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,8 +1567,13 @@ postcore_initcall(audit_init);
15671567
/* Process kernel command-line parameter at boot time. audit=0 or audit=1. */
15681568
static int __init audit_enable(char *str)
15691569
{
1570-
audit_default = !!simple_strtol(str, NULL, 0);
1571-
if (!audit_default)
1570+
long val;
1571+
1572+
if (kstrtol(str, 0, &val))
1573+
panic("audit: invalid 'audit' parameter value (%s)\n", str);
1574+
audit_default = (val ? AUDIT_ON : AUDIT_OFF);
1575+
1576+
if (audit_default == AUDIT_OFF)
15721577
audit_initialized = AUDIT_DISABLED;
15731578
audit_enabled = audit_default;
15741579
audit_ever_enabled = !!audit_enabled;

0 commit comments

Comments
 (0)