summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-06-12 10:41:34 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-06-12 10:41:34 -0700
commit86bcb4d5ab4e97f57d9c293c6222fad7de2ffdc3 (patch)
tree682435087d33400e17da600c7549d35848536a2d /drivers
parent5be88659126d5405b362040fbf823f00e66ca3f9 (diff)
parentdb95e66a9719f532ded26a04c18028372cd3b992 (diff)
Merge "SDM660: ADSPRPC: Handle NULL pointer dereference"
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/adsprpc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c
index 14c833691194..a7c21407a814 100644
--- a/drivers/char/adsprpc.c
+++ b/drivers/char/adsprpc.c
@@ -1686,6 +1686,9 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
int namelen;
int pageslen;
} inbuf;
+
+ if (!init->filelen)
+ goto bail;
VERIFY(err, proc_name = kzalloc(init->filelen, GFP_KERNEL));
if (err)
goto bail;
@@ -1694,7 +1697,7 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
if (err)
goto bail;
inbuf.pgid = current->tgid;
- inbuf.namelen = strlen(proc_name)+1;
+ inbuf.namelen = init->filelen;
inbuf.pageslen = 0;
if (!me->staticpd_flags) {
inbuf.pageslen = 1;