summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-05-15 03:51:25 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-15 03:51:24 -0700
commite7c8de8d940c8d9105a5716cadf74bac62feae9a (patch)
tree86ba536d7213a21737a4d4b94f264caa7660a905
parentcdcdb7a314ea1afde7dab5a698068e55788fbdeb (diff)
parent6a4c4fcfe2066f86eef3650e0468402cb71b3d70 (diff)
Merge "scsi: ufs: Initialize cmd_id and check lrbp->cmd NULL"
-rw-r--r--drivers/scsi/ufs/ufshcd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 9e64e0c34f57..a90c51a113d2 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -653,7 +653,7 @@ static inline void ufshcd_cond_add_cmd_trace(struct ufs_hba *hba,
struct ufshcd_lrb *lrbp;
char *cmd_type;
u8 opcode = 0;
- u8 cmd_id, idn = 0;
+ u8 cmd_id = 0, idn = 0;
sector_t lba = -1;
int transfer_len = -1;
@@ -674,7 +674,7 @@ static inline void ufshcd_cond_add_cmd_trace(struct ufs_hba *hba,
}
}
- if (lrbp->command_type == UTP_CMD_TYPE_SCSI) {
+ if (lrbp->cmd && (lrbp->command_type == UTP_CMD_TYPE_SCSI)) {
cmd_type = "scsi";
cmd_id = (u8)(*lrbp->cmd->cmnd);
} else if (lrbp->command_type == UTP_CMD_TYPE_DEV_MANAGE) {