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:
Prabha
2021-09-13 13:25:42 +05:30
committed by prabha
parent 05996fd8ab
commit cd8a4c01a6

View File

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