diff options
| author | Marek Behún <[email protected]> | 2021-09-25 02:49:18 +0200 |
|---|---|---|
| committer | Ramon Fried <[email protected]> | 2021-09-28 18:50:55 +0300 |
| commit | 4d515607ddab653492033323e7666a92adfdf7b1 (patch) | |
| tree | 2f97d57b2d6fc6831e28c00d16f172bb2a09c414 | |
| parent | 019801863b64c69e98c7ce04ae6380af560affd0 (diff) | |
arm: mvebu: turris_omnia: fix leaked mtd device
After getting MTD device via get_mtd_device_nm(), we need to put it with
put_mtd_device(), otherwise we get
Removing MTD device #0 (mx25l6405d) with use count 1
before booting kernel.
Signed-off-by: Marek Behún <[email protected]>
Reviewed-by: Pali Rohár <[email protected]>
Tested-by: Pali Rohár <[email protected]>
Reviewed-by: Stefan Roese <[email protected]>
| -rw-r--r-- | board/CZ.NIC/turris_omnia/turris_omnia.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index bac78af04e0..a48e1f5c305 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -647,10 +647,13 @@ int ft_board_setup(void *blob, struct bd_info *bd) if (!fixup_mtd_partitions(blob, node, mtd)) goto fail; + put_mtd_device(mtd); return 0; fail: printf("Failed fixing SPI NOR partitions!\n"); + if (!IS_ERR_OR_NULL(mtd)) + put_mtd_device(mtd); return 0; } #endif |
