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@xxxxxxxxx> --- drivers/staging/ks7010/ks7010_sdio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 5b6c7a7..10e697d 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -657,8 +657,11 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card) /* 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; } -- 2.7.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel