staging: ks7010: check sdio_set_block_size return value
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Mon, 23 Apr 2018 13:44:44 +0000 (15:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2018 13:47:23 +0000 (15:47 +0200)
This commit checks sdio_set_block_size function return value.
If it fails abort driver initialization.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks7010_sdio.c

index fe4beb04f0100cf029ee0596906aa188c550982e..1d569ef96f45de248e1ea52997d0a7976b9c98e3 100644 (file)
@@ -994,6 +994,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
        sdio_claim_host(func);
 
        ret = sdio_set_block_size(func, KS7010_IO_BLOCK_SIZE);
+       if (ret)
+               goto err_free_card;
+
        dev_dbg(&card->func->dev, "multi_block=%d sdio_set_block_size()=%d %d\n",
                func->card->cccr.multi_block, func->cur_blksize, ret);