Patchwork AW: UBI leb_write_unlock NULL pointer Oops (continuation)

login
register
mail settings
Submitter Wiedemer, Thorsten (Lawo AG)
Date Feb. 4, 2014, 5:52 p.m.
Message ID <D7B1B5F4F3F27A4CB073BF422331203F2A18A7474B@Exchange1.lawo.de>
Download mbox | patch
Permalink /patch/316695/
State New
Headers show

Comments

Wiedemer, Thorsten (Lawo AG) - Feb. 4, 2014, 5:52 p.m.
Ehmm, OK, OK, even with the changes in kernel, ubi_assert() in leb_write_unlock() wouldn't have triggered ...

Thorsten

Patch

diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index 0e11671d..48fd2aa 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -301,6 +301,7 @@  static void leb_write_unlock(struct ubi_device *ubi, int vol_id, int lnum)

        spin_lock(&ubi->ltree_lock);
        le = ltree_lookup(ubi, vol_id, lnum);
+       ubi_assert(le);
        le->users -= 1;
        ubi_assert(le->users >= 0);
        up_write(&le->mutex);