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

Commit 084930e1 authored by Subhash Jadavani's avatar Subhash Jadavani Committed by David Keitel
Browse files

scsi: ufs_quirks: fix card model string copy



Product name string (referred as "model" string in driver) starts from
offset 02h in Product Name String Descriptor but currently we copy the
product name from 00h offset of the descriptor which is incorrect.
This change fixes the above problem by copying the product name from
the right offset of the Product Name String Descriptor.

Change-Id: I0ab2ecc19c7383d9782ba57af6441175d2ecda46
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent 878c98c0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -48,7 +48,12 @@ int ufs_get_device_info(struct ufs_hba *hba, struct ufs_card_info *card_data)
		goto out;

	str_desc_buf[QUERY_DESC_STRING_MAX_SIZE] = '\0';
	strlcpy(card_data->model, str_desc_buf, MAX_MODEL_LEN + 1);
	strlcpy(card_data->model, (str_desc_buf + QUERY_DESC_HDR_SIZE),
		min_t(u8, str_desc_buf[QUERY_DESC_LENGTH_OFFSET],
		      MAX_MODEL_LEN));
	/* Null terminate the model string */
	card_data->model[MAX_MODEL_LEN] = '\0';

out:
	return err;
}