diff options
author | Stanley Chu <stanley.chu@mediatek.com> | 2020-03-18 18:40:10 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-03-26 22:07:12 -0400 |
commit | ba0320fbb809de541a9b396e153171151607bac8 (patch) | |
tree | 1a9541ad3254ec02a01a278c37fa65f0f8bbdc74 /drivers/scsi/ufs | |
parent | 82b8cf40bfe1077d8d757e223eb7a35c25f650ec (diff) | |
download | linux-ba0320fbb809de541a9b396e153171151607bac8.tar.bz2 |
scsi: ufs: fix uninitialized tx_lanes in ufshcd_disable_tx_lcc()
In ufshcd_disable_tx_lcc(), if ufshcd_dme_get() or ufshcd_dme_peer_get()
get fail, uninitialized variable "tx_lanes" may be used as unexpected lane
ID for DME configuration.
Fix this issue by initializing "tx_lanes".
Link: https://lore.kernel.org/r/20200318104016.28049-2-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Can Guo <cang@codeaurora.org>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 2a2a63b68a67..597b704dea57 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4249,7 +4249,7 @@ EXPORT_SYMBOL_GPL(ufshcd_hba_enable); static int ufshcd_disable_tx_lcc(struct ufs_hba *hba, bool peer) { - int tx_lanes, i, err = 0; + int tx_lanes = 0, i, err = 0; if (!peer) ufshcd_dme_get(hba, UIC_ARG_MIB(PA_CONNECTEDTXDATALANES), |