[PATCH] mtd: mtdswap: remove debugfs stats file on teardown

Miquel Raynal miquel.raynal at bootlin.com
Mon Jun 22 02:19:14 PDT 2026


Hello,

> @@ -1463,6 +1465,8 @@ static void mtdswap_remove_dev(struct mtd_blktrans_dev *dev)
>  {
>  	struct mtdswap_dev *d = MTDSWAP_MBD_TO_MTDSWAP(dev);
>  
> +	if (!IS_ERR_OR_NULL(d->debugfs_stats))
> +		debugfs_remove(d->debugfs_stats);

Please check debugfs_remove() implementation, the 'if' condition
is already handled and therefore does not need to be done here.

Thanks,
Miquèl



More information about the linux-mtd mailing list