[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181227193554.25448-1-pakki001@umn.edu>
Date: Thu, 27 Dec 2018 13:35:53 -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] staging: rts5208: Add a check for ms_read_extra_data
In ms_copy_page, the function ms_read_extra_data may fail for many
reasons. The fix adds a check similar to other invocation to return
error upstream.
Signed-off-by: Aditya Pakki <pakki001@....edu>
---
drivers/staging/rts5208/ms.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
index 04b588b8b376..8eb6221e4cc8 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -1676,7 +1676,10 @@ static int ms_copy_page(struct rtsx_chip *chip, u16 old_blk, u16 new_blk,
return STATUS_FAIL;
}
- ms_read_extra_data(chip, old_blk, i, extra, MS_EXTRA_SIZE);
+ retval = ms_read_extra_data(chip, old_blk, i, extra,
+ MS_EXTRA_SIZE);
+ if (retval != STATUS_SUCCESS)
+ return STATUS_FAIL;
retval = ms_set_rw_reg_addr(chip, OverwriteFlag,
MS_EXTRA_SIZE, SystemParm, 6);
--
2.17.1
Powered by blists - more mailing lists