projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6405871
)
remoteproc: qcom: replace kstrdup with kstrndup
author
Mukesh Ojha
<quic_mojha@quicinc.com>
Tue, 14 Feb 2023 14:08:11 +0000
(19:38 +0530)
committer
Bjorn Andersson
<andersson@kernel.org>
Tue, 14 Feb 2023 16:21:01 +0000
(08:21 -0800)
Since, there is no guarantee that region.name will be 0-terminated
from the firmware side, replace kstrdup with kstrndup.
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link:
https://lore.kernel.org/r/1676383691-29738-1-git-send-email-quic_mojha@quicinc.com
drivers/remoteproc/qcom_common.c
patch
|
blob
|
history
diff --git
a/drivers/remoteproc/qcom_common.c
b/drivers/remoteproc/qcom_common.c
index 020349f8979d8f9bfbc88e14198d2e9bea2c9242..7810f91d3080a2e768d201c8ac173656ff4f998d 100644
(file)
--- a/
drivers/remoteproc/qcom_common.c
+++ b/
drivers/remoteproc/qcom_common.c
@@
-124,7
+124,7
@@
static int qcom_add_minidump_segments(struct rproc *rproc, struct minidump_subsy
for (i = 0; i < seg_cnt; i++) {
memcpy_fromio(®ion, ptr + i, sizeof(region));
if (region.valid == MD_REGION_VALID) {
- name = kstr
dup(region.name
, GFP_KERNEL);
+ name = kstr
ndup(region.name, MAX_REGION_NAME_LENGTH - 1
, GFP_KERNEL);
if (!name) {
iounmap(ptr);
return -ENOMEM;