diff options
| author | Bean Huo <beanhuo@micron.com> | 2025-11-08 00:05:17 +0100 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2025-11-10 12:36:19 -0500 |
| commit | d794b499f948801f54d67ddbc34a6eac5a6d150a (patch) | |
| tree | 651e20deb949b9e806163377fe2d00fe45386e73 /tools/lib/python/kdoc/kdoc_item.py | |
| parent | 0d9a7085ec24983b5b8a4971c0eb6c756c75f1bf (diff) | |
scsi: ufs: core: fix incorrect buffer duplication in ufshcd_read_string_desc()
The function ufshcd_read_string_desc() was duplicating memory starting
from the beginning of struct uc_string_id, which included the length and
type fields. As a result, the allocated buffer contained unwanted
metadata in addition to the string itself.
The correct behavior is to duplicate only the Unicode character array in
the structure. Update the code so that only the actual string content is
copied into the new buffer.
Fixes: 5f57704dbcfe ("scsi: ufs: Use kmemdup in ufshcd_read_string_desc()")
Reviewed-by: Avri Altman <avri.altman@sandisk.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Link: https://patch.msgid.link/20251107230518.4060231-3-beanhuo@iokpp.de
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_item.py')
0 files changed, 0 insertions, 0 deletions
