Re: WARNING in __init_work
From: Christoph Hellwig
Date: Mon Oct 18 2021 - 04:15:12 EST
On Mon, Oct 18, 2021 at 03:21:18PM +0800, Zqiang wrote:
> I find in add_partition(), if the device_add() return error, we will drop
> disk object reference count,
>
> but i find put_device(pdev) (will call part_release())and put_disk(disk),
> both will reduce the reference of the disk object , however we call
> get_device(disk_to_dev(disk)) only once
>
> or Did I miss something and didn't analyze it?
Yes, this sounds correct. Do you want to send a patch or should I
prepare one?