android_kernel_oneplus_msm8998/drivers/mtd/ubi
Boris Brezillon 69e14ce883 ubi: fastmap: Fix add_vol() return value test in ubi_attach_fastmap()
commit 40b6e61ac72e99672e47cdb99c8d7d226004169b 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
..
attach.c UBI: drop null test before destroy functions 2015-10-03 20:36:10 +02:00
block.c Minor merge needed, due to function move. 2015-07-01 10:49:25 -07:00
build.c ubi: Fix race condition between ubi device creation and udev 2016-08-20 18:09:26 +02:00
cdev.c UBI: Remove in vain semicolon 2015-11-06 23:26:51 +01:00
debug.c UBI: fix return error code 2015-12-16 22:45:04 +01:00
debug.h UBI: power cut emulation for testing 2015-04-13 21:05:17 +02:00
eba.c ubi: Make recover_peb power cut aware 2016-07-27 09:47:33 -07:00
fastmap-wl.c ubi: fastmap: Implement produce_free_peb() 2015-10-03 23:25:30 +02:00
fastmap.c ubi: fastmap: Fix add_vol() return value test in ubi_attach_fastmap() 2016-11-10 16:36:37 +01:00
gluebi.c UBI: Update comments to reflect UBI_METAONLY flag 2015-10-03 20:11:59 +02:00
io.c UBI: fix use of "VID" vs. "EC" in header self-check 2015-12-16 22:46:26 +01:00
kapi.c VFS: assorted d_backing_inode() annotations 2015-04-15 15:06:59 -04:00
Kconfig
Makefile
misc.c
ubi-media.h UBI: Fix typo in comment 2015-10-03 20:09:41 +02:00
ubi.h UBI: Fix static volume checks when Fastmap is used 2016-06-01 12:15:54 -07:00
upd.c ubi: Fix out of bounds write in volume update code 2016-03-09 15:34:56 -08:00
vmt.c ubi: Make volume resize power cut aware 2016-08-20 18:09:25 +02:00
vtbl.c UBI: return ENOSPC if no enough space available 2015-09-29 12:47:05 +02:00
wl.c ubi: Deal with interrupted erasures in WL 2016-10-28 03:01:28 -04:00
wl.h UBI: Fastmap: Remove is_fm_block() 2015-03-26 22:47:38 +01:00