mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-05 14:17:43 +00:00
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>
This commit is contained in:
parent
3013bf62b6
commit
682a60446b
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue