Commit 6e043704 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: ks7010: fix error handling in ks7010_upload_firmware

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: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e6156f6
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment