On Sun, Apr 06, 2025 at 12:05:46AM +0800, Wentao Liang wrote:
The sdio_read32() calls sd_read(), but does not handle the error if sd_read() fails. This could lead to subsequent operations processing invalid data. A proper implementation can be found in sdio_readN().
Add error handling for the sd_read() to free tmpbuf and return error code if sd_read() fails. This ensure that the memcpy() is only performed when the read operation is successful.
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Cc: stable@vger.kernel.org # v4.12+ Signed-off-by: Wentao Liang vulab@iscas.ac.cn
v4: Add change log and fix error code v3: Add Cc flag v2: Change code to initialize val
Thanks!
Reviewed-by: Dan Carpenter dan.carpenter@linaro.org
regards, dan carpenter