diff options
author | Heinrich Toews <Heinrich.Toews@wago.com> | 2018-06-18 10:48:18 +0000 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-06-20 09:05:58 +0200 |
commit | 51c0c6454944d53b63de7b1f42484ed5dc64d703 (patch) | |
tree | 87554ef3c075fce6ac5df5bb2ce42fc9dd8395f3 /drivers | |
parent | e10efc50805672b426f9cdcf4e72a1ba1bd89a8b (diff) | |
download | barebox-51c0c6454944d53b63de7b1f42484ed5dc64d703.tar.gz barebox-51c0c6454944d53b63de7b1f42484ed5dc64d703.tar.xz |
nand-bb: mtd_del_bb: fix missing pointer reset
If an attached bb device was removed before the actual mtd device
the code would try due to a missing pointer reset to access
the no more present bb device handle which leads to a page fault.
This bug was made visible by commit "7649473 mtd: nand: remove
automatically created bb devices" which relys on a correct
mtd->cdev_bb handling.
Signed-off-by: Heinrich Toews <heinrich.toews@wago.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/nand-bb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c index c1977381d4..012163ebb2 100644 --- a/drivers/mtd/nand/nand-bb.c +++ b/drivers/mtd/nand/nand-bb.c @@ -316,6 +316,8 @@ void mtd_del_bb(struct mtd_info *mtd) list_del_init(&bb->list); free(bb->name); free(bb); + + mtd->cdev_bb = NULL; } /** |