Re: [PATCH 2/3] block: untangle request_queue refcounting from sysfs

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

 



On Sat, Nov 05, 2022 at 09:08:14AM +0100, Christoph Hellwig wrote:
> @@ -811,7 +772,8 @@ int blk_register_queue(struct gendisk *disk)
>  
>  	mutex_lock(&q->sysfs_dir_lock);
>  
> -	ret = kobject_add(&q->kobj, &disk_to_dev(disk)->kobj, "queue");
> +	kobject_init(&disk->queue_kobj, &blk_queue_ktype);
> +	ret = kobject_add(&disk->queue_kobj, &disk_to_dev(disk)->kobj, "queue");

Use kobject_init_and_add()?  Also, kobject_put() needs to be called on error.

- Eric



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux