[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110820134439.GA2266@pengutronix.de>
Date: Sat, 20 Aug 2011 15:44:39 +0200
From: Wolfram Sang <w.sang@...gutronix.de>
To: Julia Lawall <julia@...u.dk>
Cc: Liam Girdwood <lrg@...com>, kernel-janitors@...r.kernel.org,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
Dong Aisheng <b29396@...escale.com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] sound/soc/mxs/mxs-saif.c: add missing kfree
On Sat, Aug 20, 2011 at 08:12:40AM +0200, Julia Lawall wrote:
> diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
> index 0b3adae..4a17bc8 100644
> --- a/sound/soc/mxs/mxs-saif.c
> +++ b/sound/soc/mxs/mxs-saif.c
> @@ -523,8 +523,10 @@ static int mxs_saif_probe(struct platform_device *pdev)
> if (!saif)
> return -ENOMEM;
>
> - if (pdev->id >= ARRAY_SIZE(mxs_saif))
> - return -EINVAL;
> + if (pdev->id >= ARRAY_SIZE(mxs_saif)) {
> + ret = -EINVAL;
> + goto failed;
> + }
> mxs_saif[pdev->id] = saif;
Thanks, Julia. May I suggest to simple move the id-check before the
allocation?
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists