mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
s390/dasd: fix double module refcount decrement
[ Upstream commitc3116e62dd
] Once the discipline is associated with the device, deleting the device takes care of decrementing the module's refcount. Doing it manually on this error path causes refcount to artificially decrease on each error while it should just stay the same. Fixes:c020d722b1
("s390/dasd: fix panic during offline processing") Signed-off-by: Miroslav Franc <mfranc@suse.cz> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Stefan Haberland <sth@linux.ibm.com> Link: https://lore.kernel.org/r/20240209124522.3697827-3-sth@linux.ibm.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0ef87c0bb4
commit
ec09bcab32
1 changed files with 1 additions and 4 deletions
|
@ -3528,12 +3528,11 @@ int dasd_generic_set_online(struct ccw_device *cdev,
|
|||
dasd_delete_device(device);
|
||||
return -EINVAL;
|
||||
}
|
||||
device->base_discipline = base_discipline;
|
||||
if (!try_module_get(discipline->owner)) {
|
||||
module_put(base_discipline->owner);
|
||||
dasd_delete_device(device);
|
||||
return -EINVAL;
|
||||
}
|
||||
device->base_discipline = base_discipline;
|
||||
device->discipline = discipline;
|
||||
|
||||
/* check_device will allocate block device if necessary */
|
||||
|
@ -3541,8 +3540,6 @@ int dasd_generic_set_online(struct ccw_device *cdev,
|
|||
if (rc) {
|
||||
dev_warn(dev, "Setting the DASD online with discipline %s failed with rc=%i\n",
|
||||
discipline->name, rc);
|
||||
module_put(discipline->owner);
|
||||
module_put(base_discipline->owner);
|
||||
dasd_delete_device(device);
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue