Merge "scsi: ufs: validate input args to queuecommand"
This commit is contained in:
commit
564fc4f080
1 changed files with 9 additions and 7 deletions
|
@ -2769,6 +2769,9 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
|
||||||
|
|
||||||
hba = shost_priv(host);
|
hba = shost_priv(host);
|
||||||
|
|
||||||
|
if (!cmd || !cmd->request || !hba)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
tag = cmd->request->tag;
|
tag = cmd->request->tag;
|
||||||
if (!ufshcd_valid_tag(hba, tag)) {
|
if (!ufshcd_valid_tag(hba, tag)) {
|
||||||
dev_err(hba->dev,
|
dev_err(hba->dev,
|
||||||
|
@ -2854,12 +2857,11 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
|
||||||
ufshcd_vops_pm_qos_req_start(hba, cmd->request);
|
ufshcd_vops_pm_qos_req_start(hba, cmd->request);
|
||||||
|
|
||||||
/* IO svc time latency histogram */
|
/* IO svc time latency histogram */
|
||||||
if (hba != NULL && cmd->request != NULL) {
|
|
||||||
if (hba->latency_hist_enabled &&
|
if (hba->latency_hist_enabled &&
|
||||||
(cmd->request->cmd_type == REQ_TYPE_FS)) {
|
(cmd->request->cmd_type == REQ_TYPE_FS)) {
|
||||||
cmd->request->lat_hist_io_start = ktime_get();
|
cmd->request->lat_hist_io_start = ktime_get();
|
||||||
cmd->request->lat_hist_enabled = 1;
|
cmd->request->lat_hist_enabled = 1;
|
||||||
} else
|
} else {
|
||||||
cmd->request->lat_hist_enabled = 0;
|
cmd->request->lat_hist_enabled = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue