staging: wilc1000: fix missing read_write setting when reading data
authorColin Ian King <[email protected]>
Wed, 19 Dec 2018 16:30:07 +0000 (16:30 +0000)
committerGreg Kroah-Hartman <[email protected]>
Thu, 20 Dec 2018 15:32:13 +0000 (16:32 +0100)
Currently the cmd.read_write setting is not initialized so it contains
garbage from the stack.  Fix this by setting it to 0 to indicate a
read is required.

Detected by CoverityScan, CID#1357925 ("Uninitialized scalar variable")

Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Colin Ian King <[email protected]>
Cc: stable <[email protected]>
Acked-by: Ajay Singh <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/staging/wilc1000/wilc_sdio.c

index 27fdfbdda5c04a5735879dfcf8399836e974f762..e2f739fef21cffad207552409a76f8cf2aa0eda1 100644 (file)
@@ -861,6 +861,7 @@ static int sdio_read_int(struct wilc *wilc, u32 *int_status)
        if (!sdio_priv->irq_gpio) {
                int i;
 
+               cmd.read_write = 0;
                cmd.function = 1;
                cmd.address = 0x04;
                cmd.data = 0;