Re: [PATCH] s390/dasd: fix double module refcount decrement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/01/2024 17:01, Miroslav Franc wrote:
> 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: c020d722b110 ("s390/dasd: fix panic during offline processing")
> Signed-off-by: Miroslav Franc <mfranc@xxxxxxx>
> ---
>  drivers/s390/block/dasd.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
> index 833cfab7d877..739da1c2b71f 100644
> --- a/drivers/s390/block/dasd.c
> +++ b/drivers/s390/block/dasd.c
> @@ -3546,8 +3546,6 @@ int dasd_generic_set_online(struct ccw_device *cdev,
>  	if (rc) {
>  		pr_warn("%s Setting the DASD online with discipline %s failed with rc=%i\n",
>  			dev_name(&cdev->dev), discipline->name, rc);
> -		module_put(discipline->owner);
> -		module_put(base_discipline->owner);

Good catch. I think there is one more line above this part that should
also be removed:

if (!try_module_get(discipline->owner)) {
        module_put(base_discipline->owner); <---
        dasd_delete_device(device);
        return -EINVAL;
}

Can you add it to the patch? Thanks!

>  		dasd_delete_device(device);
>  		return rc;
>  	}
> 





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux