Re: [PATCH V2 6/6] null_blk: free global tag_set on init error path

From: Damien Le Moal

Date: Tue Jul 07 2026 - 00:25:08 EST


On 7/7/26 11:55, Zizhi Wo wrote:
> From: Zizhi Wo <wozizhi@xxxxxxxxxx>
>
> If shared_tags is enabled, null_setup_tagset() allocates the global tag_set
> via null_init_global_tag_set(). If device creation later fails, err_dev
> destroys the default devices and calls unregister_blkdev(), but never frees
> the global tag_set. Since module init failed, null_exit() is never invoked,
> so the global tag_set's tags and maps are permanently leaked.
>
> Free the global tag_set in err_dev, matching null_exit() which does
> if (tag_set.ops) blk_mq_free_tag_set(&tag_set).
>
> Fixes: 82f402fefa50 ("null_blk: add support for shared tags")
> Signed-off-by: Zizhi Wo <wozizhi@xxxxxxxxxx>

Looks OK.

Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx>

--
Damien Le Moal
Western Digital Research