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:
Yaniv Gardi <ygardi@codeaurora.org>
Loading
Please register or sign in to comment