[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180801165039.261462592@linuxfoundation.org>
Date: Wed, 1 Aug 2018 18:50:02 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Sergio Paracuellos <sergio.paracuellos@...il.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Sasha Levin <alexander.levin@...rosoft.com>
Subject: [PATCH 4.17 267/336] staging: ks7010: fix error handling in ks7010_upload_firmware
4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergio Paracuellos <sergio.paracuellos@...il.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@...il.com>
Reviewed-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.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;
}
Powered by blists - more mailing lists