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:
parent
b7d425e951
commit
db95e66a97
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue