projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3013bf6
)
misc: fastrpc: Fix return value check in fastrpc_map_create()
author
Wei Yongjun
<weiyongjun1@huawei.com>
Sat, 16 Feb 2019 01:35:43 +0000
(
01:35
+0000)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 19 Feb 2019 13:50:11 +0000
(14:50 +0100)
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>
drivers/misc/fastrpc.c
patch
|
blob
|
history
diff --git
a/drivers/misc/fastrpc.c
b/drivers/misc/fastrpc.c
index
89aec17
..
39f832d
100644
(file)
--- 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;
}