]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
staging: wilc1000: fix missing read_write setting when reading data
authorColin Ian King <colin.king@canonical.com>
Wed, 19 Dec 2018 16:30:07 +0000 (16:30 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1837257
commit c58eef061dda7d843dcc0ad6fea7e597d4c377c0 upstream.

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 <colin.king@canonical.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/wilc1000/wilc_sdio.c

index 0189e3edbbbe631e730ad9a6ee2dc5c25ac79946..a4b2bfc31503c1ba6d58c060116956b142256855 100644 (file)
@@ -823,6 +823,7 @@ static int sdio_read_int(struct wilc *wilc, u32 *int_status)
        if (!g_sdio.irq_gpio) {
                int i;
 
+               cmd.read_write = 0;
                cmd.function = 1;
                cmd.address = 0x04;
                cmd.data = 0;