Skip to content

Commit 82503f8

Browse files
committed
mtd: rawnand: nandsim: Use an additional label when freeing the nandsim object
Cosmetic change to give a meaning to all labels in this complicated error path. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent d6e4fd5 commit 82503f8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/mtd/nand/raw/nandsim.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,16 +2387,16 @@ static int __init ns_init_module(void)
23872387

23882388
ret = nand_create_bbt(chip);
23892389
if (ret)
2390-
goto err_exit;
2390+
goto free_ns_object;
23912391

23922392
ret = ns_parse_badblocks(ns, nsmtd);
23932393
if (ret)
2394-
goto err_exit;
2394+
goto free_ns_object;
23952395

23962396
/* Register NAND partitions */
23972397
ret = mtd_device_register(nsmtd, &ns->partitions[0], ns->nbparts);
23982398
if (ret)
2399-
goto err_exit;
2399+
goto free_ns_object;
24002400

24012401
ret = ns_debugfs_create(ns);
24022402
if (ret)
@@ -2407,6 +2407,7 @@ static int __init ns_init_module(void)
24072407
unregister_mtd:
24082408
WARN_ON(mtd_device_unregister(nsmtd));
24092409
err_exit:
2410+
free_ns_object:
24102411
ns_free(ns);
24112412
nand_cleanup(chip);
24122413
error:

0 commit comments

Comments
 (0)