public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rts5208: add a missing check for the status of command sending
@ 2018-12-20  7:57 Kangjie Lu
  2018-12-20  9:09 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kangjie Lu @ 2018-12-20  7:57 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Greg Kroah-Hartman, Dan Carpenter, Kees Cook,
	Arnd Bergmann, Aymen Qader, devel, linux-kernel

ms_send_cmd() may fail. The fix checks the return value of it, and if it
fails, returns the error "STATUS_FAIL" upstream.

Signed-off-by: Kangjie Lu <kjlu@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..5a9e562465e9 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -2731,7 +2731,9 @@ static int mspro_rw_multi_sector(struct scsi_cmnd *srb,
 		}
 
 		if (val & MS_INT_BREQ)
-			ms_send_cmd(chip, PRO_STOP, WAIT_INT);
+			retval = ms_send_cmd(chip, PRO_STOP, WAIT_INT);
+			if (retval != STATUS_SUCCESS)
+				return STATUS_FAIL;
 
 		if (val & (MS_CRC16_ERR | MS_RDY_TIMEOUT)) {
 			dev_dbg(rtsx_dev(chip), "MSPro CRC error, tune clock!\n");
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-20 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-20  7:57 [PATCH] rts5208: add a missing check for the status of command sending Kangjie Lu
2018-12-20  9:09 ` Dan Carpenter
2018-12-20  9:27 ` Dan Carpenter
2018-12-20 17:31 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox