Message ID | 20200531150831.9946-4-huobean@gmail.com |
---|---|
State | New |
Headers | show |
Series | [v4,1/5] scsi: ufs: remove max_t in ufs_get_device_desc | expand |
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index f7e8bfefe3d4..bc52a0e89cd3 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3211,7 +3211,7 @@ int ufshcd_read_desc_param(struct ufs_hba *hba, /* Check wherher we will not copy more data, than available */ if (is_kmalloc && param_size > buff_len) - param_size = buff_len; + param_size = buff_len - param_offset; if (is_kmalloc) memcpy(param_read_buf, &desc_buf[param_offset], param_size);