Commit 682a6044 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

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: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3013bf62
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment