Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit fd070e27 authored by Yaniv Gardi's avatar Yaniv Gardi
Browse files

scsi: ufs: null terminate buffer that is sent to strlcpy



strlcpy() must get null-terminated buffer as a second argument because
inside strlcpy(), strlen() is invoked on that argument, and unterminated
buffer will result incorrect value.
In this case, str_desc_buf is a buffer that might return from
ufshcd_read_string_desc() when it is no longer null-terminated.
Therefor we must null-terminate it before sending it to strlcpy().

This change also fixes the type of the vendor variable that is read
from the device descriptor. According to UFS device specification this
field is 2 bytes wide. Its name is also changed to be compatible
with UFS device specification.

Change-Id: I3b1ba0311846881a1f3f1c984cc6f9d7109821b3
Signed-off-by: default avatarYaniv Gardi <ygardi@codeaurora.org>
parent 681cdee2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment