diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2019-02-16 02:35:43 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-19 14:50:11 +0100 |
commit | 682a60446b150f3058b77806768977f4dff0fffb (patch) | |
tree | 8b1db04a3ac3f90afdf89563a542b1f28c40e66f /drivers/misc/fastrpc.c | |
parent | binder: reduce mmap_sem write-side lock (diff) | |
download | linux-682a60446b150f3058b77806768977f4dff0fffb.tar.xz linux-682a60446b150f3058b77806768977f4dff0fffb.zip |
misc: fastrpc: Fix return value check in fastrpc_map_create()
In case of error, the function dma_buf_get() returns ERR_PTR() and never
returns NULL. The NULL test in the return value check should be replaced
with IS_ERR().
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/fastrpc.c')
-rw-r--r-- | drivers/misc/fastrpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 89aec17738ef..39f832d27288 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -496,8 +496,8 @@ static int fastrpc_map_create(struct fastrpc_user *fl, int fd, map->fl = fl; map->fd = fd; map->buf = dma_buf_get(fd); - if (!map->buf) { - err = -EINVAL; + if (IS_ERR(map->buf)) { + err = PTR_ERR(map->buf); goto get_err; } |