Re: [PATCH v2 2/3] scsi: ufs: core: fix incorrect buffer duplication in ufshcd_read_string_desc()

From: Bart Van Assche
Date: Wed Oct 01 2025 - 15:43:42 EST


On 9/30/25 11:08 PM, Bean Huo wrote:
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.

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>