mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
ipmi: Remove all sysfs files on registration failure
ipmi_add_smi() creates the nr_users and nr_msgs files before trying to
create the maintenance_mode file. If that last creation fails, the error
path removes only nr_users before dropping the final reference to the
interface.
Remove nr_msgs as well so no sysfs attribute embedded in the freed
interface remains registered.
Fixes: 627118470f ("ipmi: Add a maintenance mode sysfs file")
Cc: stable@vger.kernel.org # 6.18
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Message-ID: <20260803015550.618808-1-dbgh9129@gmail.com>
Signed-off-by: Corey Minyard <corey@minyard.net>
This commit is contained in:
parent
6d920a75df
commit
b6c46ab0bd
|
|
@ -3740,6 +3740,7 @@ int ipmi_add_smi(struct module *owner,
|
|||
sysfs_attr_init(&intf->maintenance_mode_devattr.attr);
|
||||
rv = device_create_file(intf->si_dev, &intf->maintenance_mode_devattr);
|
||||
if (rv) {
|
||||
device_remove_file(intf->si_dev, &intf->nr_msgs_devattr);
|
||||
device_remove_file(intf->si_dev, &intf->nr_users_devattr);
|
||||
goto out_err_bmc_reg;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user