linux/drivers/soc
Douglas Anderson fe72f9bce1 soc: qcom: cmd-db: replace strscpy_pad() with strncpy()
Commit ac0126a017 ("soc: qcom: cmd-db: replace strncpy() with
strscpy_pad()") breaks booting on my sc7280-herobrine-herobrine
device. From printouts I see that at bootup the function is called
with an id of "lnbclka2" which is 8 bytes big.

Previously all 8 bytes of this string were copied to the
destination. Now only 7 bytes will be copied since strscpy_pad() saves
a byte for '\0' termination.

We don't need the '\0' termination in the destination. Let's go back
to strncpy(). According to the warning:
  If a caller is using non-NUL-terminated strings, strncpy() can still
  be used, but destinations should be marked with the __nonstring
  attribute to avoid future compiler warnings.
...so we'll do that.

While we're at it, let's change the query array to use
"sizeof(ent->id)" so it can't possibly go out of sync with our later
copy.

Fixes: ac0126a017 ("soc: qcom: cmd-db: replace strncpy() with strscpy_pad()")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220628064301.v3.1.Ie7b480cd99e2c13319220cbc108caf2bcd41286b@changeid
2022-06-28 14:44:44 -05:00
..
actions soc: actions: include header to fix missing prototype 2020-09-22 12:45:16 +05:30
amlogic soc: s4: Add support for power domains controller 2022-03-07 09:40:39 +01:00
apple soc: apple: Add SART driver 2022-05-02 17:24:45 +02:00
aspeed soc: aspeed: lpc-ctrl: Block error printing on probe defer cases 2022-02-08 09:52:59 +01:00
atmel ARM: at91: add support in soc driver for new SAMA5D29 2022-03-04 12:49:22 +01:00
bcm soc: bcm: Check for NULL return of devm_kzalloc() 2022-04-26 09:12:35 -07:00
canaan riscv: canaan: remove useless select of non-existing config SYSCON 2022-01-20 09:35:11 -08:00
dove
fsl Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-03 11:55:12 -08:00
gemini
imx ARM: driver changes for 5.19 2022-05-26 10:32:47 -07:00
ixp4xx soc: ixp4xx/qmgr: Fix unused match warning 2022-05-27 16:02:21 +02:00
lantiq
litex drivers/soc/litex: remove 8-bit subregister option 2021-06-11 04:35:40 +09:00
mediatek soc: mediatek: mutex: remove mt8195 MOD0 and SOF0 definition 2022-04-25 12:46:13 +02:00
microchip ARM driver updates for 5.18 2022-03-23 18:23:13 -07:00
pxa ARM: pxa: move plat-pxa to drivers/soc/ 2022-05-07 22:56:16 +02:00
qcom soc: qcom: cmd-db: replace strscpy_pad() with strncpy() 2022-06-28 14:44:44 -05:00
renesas soc: renesas: R-Car V3U is R-Car Gen4 2022-05-05 12:31:22 +02:00
rockchip Refcount leak for a used of-node in the grf-init. 2022-05-27 22:19:48 +02:00
samsung MAINTAINERS: update Krzysztof Kozlowski's email 2022-03-07 23:46:03 +01:00
sifive RISC-V: sifive_l2_cache: Update L2 cache driver to support SiFive FU740 2021-01-07 17:28:27 -08:00
sunxi soc: sunxi_sram: Make use of the helper function devm_platform_ioremap_resource() 2021-09-13 09:04:05 +02:00
tegra More power management updates for 5.19-rc1 2022-05-30 11:37:26 -07:00
ti soc: ti: wkup_m3_ipc: Add debug option to halt m3 in suspend 2022-05-03 08:02:09 -05:00
ux500 soc: ux500: Use custom soc attribute group instead of device_create_file 2020-07-06 09:48:06 +01:00
versatile soc: integrator: Drop pointless static qualifier in integrator_soc_init() 2020-08-20 08:57:05 +02:00
xilinx driver: soc: xilinx: Update function prototype for xlnx_unregister_event 2022-05-19 18:57:28 +02:00
Kconfig ARM: pxa: move plat-pxa to drivers/soc/ 2022-05-07 22:56:16 +02:00
Makefile ARM: multiplatform changes, part 2 2022-06-02 15:23:54 -07:00