Files
linux/drivers/mtd/ubi
Boris Brezillon 69e14ce883 ubi: fastmap: Fix add_vol() return value test in ubi_attach_fastmap()
commit 40b6e61ac7 upstream.

Commit e96a8a3bb6 ("UBI: Fastmap: Do not add vol if it already
exists") introduced a bug by changing the possible error codes returned
by add_vol():
- this function no longer returns NULL in case of allocation failure
  but return ERR_PTR(-ENOMEM)
- when a duplicate entry in the volume RB tree is found it returns
  ERR_PTR(-EEXIST) instead of ERR_PTR(-EINVAL)

Fix the tests done on add_vol() return val to match this new behavior.

Fixes: e96a8a3bb6 ("UBI: Fastmap: Do not add vol if it already exists")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10 16:36:37 +01:00
..
2015-11-06 23:26:51 +01:00
2015-12-16 22:45:04 +01:00
2015-04-13 21:05:17 +02:00
2016-07-27 09:47:33 -07:00
2015-10-03 20:09:41 +02:00
2016-08-20 18:09:25 +02:00
2016-10-28 03:01:28 -04:00
2015-03-26 22:47:38 +01:00