All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rts5208: Add a check on the status of ms_send_cmd
@ 2018-12-24 15:55 Aditya Pakki
  0 siblings, 0 replies; only message in thread
From: Aditya Pakki @ 2018-12-24 15:55 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Greg Kroah-Hartman, Dan Carpenter, Kees Cook, Aymen Qader,
	Arnd Bergmann, devel, linux-kernel

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@umn.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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-24 15:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-24 15:55 [PATCH] rts5208: Add a check on the status of ms_send_cmd Aditya Pakki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.