diff options
| author | Yao Zi <[email protected]> | 2025-08-03 14:49:47 +0000 |
|---|---|---|
| committer | Huacai Chen <[email protected]> | 2025-08-03 14:49:47 +0000 |
| commit | 70a2365e18affc5ebdaab1ca6a0b3c4f3aac2ee8 (patch) | |
| tree | 36ea132d6cb67d206ef07c950bc4790449506246 /drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c | |
| parent | LoongArch: Support mem=<size> kernel parameter (diff) | |
| download | kernel-70a2365e18affc5ebdaab1ca6a0b3c4f3aac2ee8.tar.gz kernel-70a2365e18affc5ebdaab1ca6a0b3c4f3aac2ee8.zip | |
LoongArch: Avoid in-place string operation on FDT content
In init_cpu_fullname(), a constant pointer to "model" property is
retrieved. It's later modified by the strsep() function, which is
illegal and corrupts kernel's FDT copy. This is shown by dmesg,
OF: fdt: not creating '/sys/firmware/fdt': CRC check failed
Create a mutable copy of the model property and do in-place operations
on the mutable copy instead. loongson_sysconf.cpuname lives across the
kernel lifetime, thus manually releasing isn't necessary.
Also move the of_node_put() call for the root node after the usage of
its property, since of_node_put() decreases the reference counter thus
usage after the call is unsafe.
Cc: [email protected]
Fixes: 44a01f1f726a ("LoongArch: Parsing CPU-related information from DTS")
Reviewed-by: Jiaxun Yang <[email protected]>
Signed-off-by: Yao Zi <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c')
0 files changed, 0 insertions, 0 deletions
