4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergio Paracuellos sergio.paracuellos@gmail.com
[ Upstream commit 6e043704fb99e3e1d7a1bb02030e49c093cdd943 ]
This commit checks missing error code check when checking if the firmware is running reading General Communication Register A (GCR_A).
It also set ret to EBUSY if firmware is running before copying it.
Signed-off-by: Sergio Paracuellos sergio.paracuellos@gmail.com Reviewed-by: Dan Carpenter dan.carpenter@oracle.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org Signed-off-by: Sasha Levin alexander.levin@microsoft.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/staging/ks7010/ks7010_sdio.c | 3 +++ 1 file changed, 3 insertions(+)
--- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -657,8 +657,11 @@ static int ks7010_upload_firmware(struct
/* Firmware running ? */ ret = ks7010_sdio_readb(priv, GCR_A, &byte); + if (ret) + goto release_host_and_free; if (byte == GCR_A_RUN) { netdev_dbg(priv->net_dev, "MAC firmware running ...\n"); + ret = -EBUSY; goto release_host_and_free; }