lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140507144306.GO7438@ldesroches-Latitude-E6320>
Date:	Wed, 7 May 2014 16:43:06 +0200
From:	Ludovic Desroches <ludovic.desroches@...el.com>
To:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
CC:	Chris Ball <chris@...ntf.net>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Ludovic Desroches <ludovic.desroches@...el.com>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <linux-mmc@...r.kernel.org>
Subject: Re: [PATCH] mmc: atmel: don't test host->data

On Tue, May 06, 2014 at 05:43:26PM +0200, Alexandre Belloni wrote:
> Found using smatch:
> drivers/mmc/host/atmel-mci.c:827 atmci_pdc_complete() warn: variable
> dereferenced before check 'host->data' (see line 807)
> 
> Stop testing host->data as it is not NULL at that point.

I agree

> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
Acked-by: Ludovic Desroches <ludovic.desroches@...el.com>

> ---
>  drivers/mmc/host/atmel-mci.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 42706ea0ba85..aece7cafbb97 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -820,16 +820,9 @@ static void atmci_pdc_complete(struct atmel_mci *host)
>  
>  	atmci_pdc_cleanup(host);
>  
> -	/*
> -	 * If the card was removed, data will be NULL. No point trying
> -	 * to send the stop command or waiting for NBUSY in this case.
> -	 */
> -	if (host->data) {
> -		dev_dbg(&host->pdev->dev,
> -		        "(%s) set pending xfer complete\n", __func__);
> -		atmci_set_pending(host, EVENT_XFER_COMPLETE);
> -		tasklet_schedule(&host->tasklet);
> -	}
> +	dev_dbg(&host->pdev->dev, "(%s) set pending xfer complete\n", __func__);
> +	atmci_set_pending(host, EVENT_XFER_COMPLETE);
> +	tasklet_schedule(&host->tasklet);
>  }
>  
>  static void atmci_dma_cleanup(struct atmel_mci *host)
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ