panic: sys_info: deduplicate local variable 'table; assignments

The both handlers use the local 'table' variable and assign the same data
to it, deduplicate that.

Link: https://lkml.kernel.org/r/20251030132007.3742368-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Feng Tang <feng.tang@linux.alibaba.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Andy Shevchenko 2025-10-30 12:44:21 +01:00 committed by Andrew Morton
parent eb72c4667f
commit f791dcc842

View File

@ -63,12 +63,13 @@ int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write,
if (!names)
return -ENOMEM;
table = *ro_table;
table.data = names;
table.maxlen = maxlen;
if (write) {
int ret;
table = *ro_table;
table.data = names;
table.maxlen = maxlen;
ret = proc_dostring(&table, write, buffer, lenp, ppos);
if (ret)
return ret;
@ -93,9 +94,6 @@ int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write,
}
}
table = *ro_table;
table.data = names;
table.maxlen = maxlen;
return proc_dostring(&table, write, buffer, lenp, ppos);
}
}