All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aditya Pakki <pakki001@umn.edu>
To: pakki001@umn.edu
Cc: kjlu@umn.edu, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Kees Cook <keescook@chromium.org>,
	Aymen Qader <qader.aymen@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] rts5208: Add a check on the status of ms_send_cmd
Date: Mon, 24 Dec 2018 09:55:12 -0600	[thread overview]
Message-ID: <20181224155514.16455-1-pakki001@umn.edu> (raw)

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


                 reply	other threads:[~2018-12-24 15:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181224155514.16455-1-pakki001@umn.edu \
    --to=pakki001@umn.edu \
    --cc=arnd@arndb.de \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qader.aymen@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.