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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}