OSDN Git Service

staging: erofs: fix to handle error path of erofs_vmap()
authorChao Yu <yuchao0@huawei.com>
Mon, 11 Mar 2019 15:10:10 +0000 (23:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:26:25 +0000 (06:26 +0200)
commita090ed15420abf719ba077e9f60defbb1f636831
treee3959ceee3b1351a2a48fe574684c95cd6a72ebb
parent3b6b76644ba59d268b24649c679f223bb4a813e8
staging: erofs: fix to handle error path of erofs_vmap()

commit 8bce6dcede65139a087ff240127e3f3c01363eed upstream.

erofs_vmap() wrapped vmap() and vm_map_ram() to return virtual
continuous memory, but both of them can failed due to a lot of
reason, previously, erofs_vmap()'s callers didn't handle them,
which can potentially cause NULL pointer access, fix it.

Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Fixes: 0d40d6e399c1 ("staging: erofs: add a generic z_erofs VLE decompressor")
Cc: <stable@vger.kernel.org> # 4.19+
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/unzip_vle.c
drivers/staging/erofs/unzip_vle_lz4.c