staging: wilc1000: fix missing read_write setting when reading data
diff mbox series

Message ID 20181219163007.5329-1-colin.king@canonical.com
State Not Applicable
Delegated to: Kalle Valo
Headers show
Series
  • staging: wilc1000: fix missing read_write setting when reading data
Related show

Commit Message

Colin King Dec. 19, 2018, 4:30 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/staging/wilc1000/wilc_sdio.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ajay Singh Dec. 20, 2018, 6:18 a.m. UTC | #1
On 12/19/2018 10:00 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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")

Acked-by: Ajay Singh <ajay.kathat@microchip.com>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/staging/wilc1000/wilc_sdio.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
> index 27fdfbdda5c0..e2f739fef21c 100644
> --- a/drivers/staging/wilc1000/wilc_sdio.c
> +++ b/drivers/staging/wilc1000/wilc_sdio.c
> @@ -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;
>

Patch
diff mbox series

diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index 27fdfbdda5c0..e2f739fef21c 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -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;