scsi: ufs-qti: Fix overwriting model name

The model name read by string descriptor is overwritten now.
This causes issues while finding the right quirk for the device.

Change-Id: Iedda88c6610ffe4a2fe8894b32fc8459fabd1931
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
This commit is contained in:
Asutosh Das 2019-12-19 20:40:01 -08:00
commit 91a062c87d

View file

@ -7809,25 +7809,19 @@ static int ufs_get_device_desc(struct ufs_hba *hba,
model_index = desc_buf[DEVICE_DESC_PARAM_PRDCT_NAME];
/* Zero-pad entire buffer for string termination. */
memset(desc_buf, 0, buff_len);
err = ufshcd_read_string_desc(hba, model_index, &dev_desc->model,
true/*ASCII*/);
if ((err < 0) || !dev_desc->model) {
if (err < 0) {
dev_err(hba->dev, "%s: Failed reading Product Name. err = %d\n",
__func__, err);
goto out;
}
/*
* ufshcd_read_string_desc returns size of the string
* reset the error value
*/
err = 0;
desc_buf[QUERY_DESC_MAX_SIZE] = '\0';
strlcpy(dev_desc->model, (desc_buf + QUERY_DESC_HDR_SIZE),
min_t(u8, desc_buf[QUERY_DESC_LENGTH_OFFSET],
MAX_MODEL_LEN));
/* Null terminate the model string */
dev_desc->model[MAX_MODEL_LEN] = '\0';
out:
kfree(desc_buf);