SDM660: ADSPRPC: Handle NULL pointer dereference

Avoid using strlen as it results in NULL pointer
dereference for NULL value.

Change-Id: I21a9793b48caddb423f081cdcf2690ded1822e88
Acked-by: Chenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
This commit is contained in:
tharun kumar 2017-05-22 19:57:39 +05:30 committed by Gerrit - the friendly Code Review server
parent b7d425e951
commit db95e66a97

View file

@ -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;