diff mbox

mmc: mxs-mmc: remove unneeded NULL check

Message ID 20141216235749.GH31467@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Dec. 16, 2014, 11:57 p.m. UTC
Static checkers complain about the inconsistent NULL checking here:

	drivers/mmc/host/mxs-mmc.c:680 mxs_mmc_probe()
	warn: variable dereferenced before check 'ssp->dmach' (see line 660)

The variable can't actually be NULL so we can remove the check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ulf Hansson Dec. 22, 2014, 9:57 a.m. UTC | #1
On 17 December 2014 at 00:57, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Static checkers complain about the inconsistent NULL checking here:
>
>         drivers/mmc/host/mxs-mmc.c:680 mxs_mmc_probe()
>         warn: variable dereferenced before check 'ssp->dmach' (see line 660)
>
> The variable can't actually be NULL so we can remove the check.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks! Applied for next.

Kind regards
Uffe

>
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 60c4ca9..a82411a 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -677,8 +677,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>         return 0;
>
>  out_free_dma:
> -       if (ssp->dmach)
> -               dma_release_channel(ssp->dmach);
> +       dma_release_channel(ssp->dmach);
>  out_clk_disable:
>         clk_disable_unprepare(ssp->clk);
>  out_mmc_free:
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 60c4ca9..a82411a 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -677,8 +677,7 @@  static int mxs_mmc_probe(struct platform_device *pdev)
 	return 0;
 
 out_free_dma:
-	if (ssp->dmach)
-		dma_release_channel(ssp->dmach);
+	dma_release_channel(ssp->dmach);
 out_clk_disable:
 	clk_disable_unprepare(ssp->clk);
 out_mmc_free: