msm: adsprpc: Allocate buffer taking NULL byte into consideration
When attaching to audiopd on ADSP, allocate one extra byte for the process name so that it is null terminated when data is copied from file pointer in the userspace. Change-Id: I98ac64a4c16f44fa4fd0e09da1648b9d78d65a82 Signed-off-by: prabha <prabha@codeaurora.org>
This commit is contained in:
@@ -2673,7 +2673,7 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
|
|||||||
if (!init->filelen)
|
if (!init->filelen)
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
||||||
proc_name = kzalloc(init->filelen, GFP_KERNEL);
|
proc_name = kzalloc(init->filelen + 1, GFP_KERNEL);
|
||||||
VERIFY(err, !IS_ERR_OR_NULL(proc_name));
|
VERIFY(err, !IS_ERR_OR_NULL(proc_name));
|
||||||
if (err)
|
if (err)
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|||||||
Reference in New Issue
Block a user