Commit ba0320fb authored by Stanley Chu's avatar Stanley Chu Committed by Martin K. Petersen

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.comReviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Reviewed-by: default avatarCan Guo <cang@codeaurora.org>
Reviewed-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 82b8cf40
...@@ -4249,7 +4249,7 @@ EXPORT_SYMBOL_GPL(ufshcd_hba_enable); ...@@ -4249,7 +4249,7 @@ EXPORT_SYMBOL_GPL(ufshcd_hba_enable);
static int ufshcd_disable_tx_lcc(struct ufs_hba *hba, bool peer) 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) if (!peer)
ufshcd_dme_get(hba, UIC_ARG_MIB(PA_CONNECTEDTXDATALANES), ufshcd_dme_get(hba, UIC_ARG_MIB(PA_CONNECTEDTXDATALANES),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment