mtd: ubi: Put MTD device after it is not used
Subsystems (2)
PATCH 1/1 mtd: ubi: Put MTD device after it is not used
The MTD device reference is dropped via put_mtd_device, however its field ->index is read and passed to ubi_msg. To fix this, the patch moves the reference dropping after calling ubi_msg.
Upstream Linux commit: b95f83ab762dd6211351b9140f99f43644076ca8
--- drivers/mtd/ubi/build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/ubi/build.c +1 -1
@@ -1152,10 +1152,10 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)ubi_wl_close (ubi);ubi_free_internal_volumes (ubi);vfree (ubi->vtbl); -put_mtd_device (ubi->mtd);vfree (ubi->peb_buf);vfree (ubi->fm_buf);ubi_msg (ubi,"mtd%d is detached" , ubi->mtd->index); +put_mtd_device (ubi->mtd);put_device (&ubi->dev);return 0 ; }
Signature · 1 line
2.43.0
Hello Alexander,
Quoted 8 lines · Alexander Vickberg
The MTD device reference is dropped via
put_mtd_device, however its field ->index is read and passed toubi_msg. To fix this, the patch moves the reference dropping after callingubi_msg.Signed-off-by Pan Bian <[email protected]>Reviewed-by Boris Brezillon <[email protected]>Signed-off-by Richard Weinberger <[email protected]>
Quoted 6 lines
Upstream Linux commit:
b95f83ab762dd6211351b9140f99f43644076ca8Signed-off-by Alexander Vickberg <[email protected]>--- drivers/mtd/ubi/build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks!
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]
Hello Alexander,
Quoted 13 lines · Heiko Schocher
Hello Alexander,
Quoted 10 lines · Alexander Vickberg
The MTD device reference is dropped via
put_mtd_device, however its field ->index is read and passed toubi_msg. To fix this, the patch moves the reference dropping after callingubi_msg.Signed-off-by Pan Bian <[email protected]>Reviewed-by Boris Brezillon <[email protected]>Signed-off-by Richard Weinberger <[email protected]>Upstream Linux commit:
b95f83ab762dd6211351b9140f99f43644076ca8
Quoted 8 lines
Quoted 4 lines
Signed-off-by Alexander Vickberg <[email protected]>---
drivers/mtd/ubi/build.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Thanks!
Reviewed-by Heiko Schocher <[email protected]>
Applied to u-boot-ubi master
Thanks!
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]