kernel_samsung_a53x/drivers/scsi/ufs
Daniel Mentz 8d2961ce73 scsi: ufs: core: Leave space for '\0' in utf8 desc string
[ Upstream commit a75a16c62a2540f11eeae4f2b50e95deefb652ea ]

utf16s_to_utf8s does not NULL terminate the output string. For us to be
able to add a NULL character when utf16s_to_utf8s returns, we need to make
sure that there is space for such NULL character at the end of the output
buffer. We can achieve this by passing an output buffer size to
utf16s_to_utf8s that is one character less than what we allocated.

Other call sites of utf16s_to_utf8s appear to be using the same technique
where they artificially reduce the buffer size by one to leave space for a
NULL character or line feed character.

Fixes: 4b828fe156a6 ("scsi: ufs: revamp string descriptor reading")
Reviewed-by: Mars Cheng <marscheng@google.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Yen-lin Lai <yenlinlai@google.com>
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Link: https://lore.kernel.org/r/20231017182026.2141163-1-danielmentz@google.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 11:43:03 +01:00
..
s5e8825 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s5e9925 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cdns-pltfrm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tc-dwc-g210-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tc-dwc-g210-pltfrm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tc-dwc-g210.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tc-dwc-g210.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-j721e-ufs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-cal-991.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-cal-991.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-cal-2100.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-debugfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-dbg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-fmp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-fmp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-gear.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-gear.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-perf-v1.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-perf-v1.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-perf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-perf.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos-srpmb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-exynos.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-hisi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-hisi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-mediatek-trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-mediatek.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-mediatek.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-qcom-ice.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-qcom.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-qcom.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-sec-feature.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-sec-feature.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-sec-sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-sec-sysfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-sysfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs-vs-regs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs_bsg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs_bsg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufs_quirks.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshcd-add-info.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshcd-crypto.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshcd-crypto.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshcd-dwc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshcd-dwc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshcd-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshcd-pltfrm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshcd-pltfrm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshcd.c scsi: ufs: core: Leave space for '\0' in utf8 desc string 2024-11-18 11:43:03 +01:00
ufshcd.h Revert "scsi: ufs: Implement IRQ-affined PM QoS for reduced latency" 2024-11-17 19:39:42 +01:00
ufshci-dwc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshpb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ufshpb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
unipro.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00