[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20181224155514.16455-1-pakki001@umn.edu>
Date: Mon, 24 Dec 2018 09:55:12 -0600
From: Aditya Pakki <pakki001@....edu>
To: pakki001@....edu
Cc: kjlu@....edu, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
Kees Cook <keescook@...omium.org>,
Aymen Qader <qader.aymen@...il.com>,
Arnd Bergmann <arnd@...db.de>, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] rts5208: Add a check on the status of ms_send_cmd
In mspro_stop_seq_mode(), ms_send_cmd() may fail. The patch attempts
to detect a failure before flushing the registers via rtsx_write_register.
Signed-off-by: Aditya Pakki <pakki001@....edu>
---
drivers/staging/rts5208/ms.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
index f53adf15c685..04b588b8b376 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -2586,7 +2586,9 @@ void mspro_stop_seq_mode(struct rtsx_chip *chip)
ms_card->seq_mode = 0;
ms_card->total_sec_cnt = 0;
- ms_send_cmd(chip, PRO_STOP, WAIT_INT);
+ retval = ms_send_cmd(chip, PRO_STOP, WAIT_INT);
+ if (retval != STATUS_SUCCESS)
+ return;
rtsx_write_register(chip, RBCTL, RB_FLUSH, RB_FLUSH);
}
--
2.17.1
Powered by blists - more mailing lists