mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02:00
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:
parent
eb72c4667f
commit
f791dcc842
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user