[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160415064747.2735370d@recife.lan>
Date: Fri, 15 Apr 2016 06:47:47 -0300
From: Mauro Carvalho Chehab <mchehab@....samsung.com>
To: Shuah Khan <shuah.kh@...sung.com>
Cc: Shuah Khan <shuahkh@....samsung.com>, <nenggun.kim@...sung.com>,
<akpm@...ux-foundation.org>, <jh1009.sung@...sung.com>,
<inki.dae@...sung.com>, <arnd@...db.de>,
<linux-media@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: saa7134 fix media_dev alloc error path to not
free when alloc fails
Em Thu, 14 Apr 2016 16:18:17 -0600
Shuah Khan <shuah.kh@...sung.com> escreveu:
> On 04/14/2016 03:08 PM, Mauro Carvalho Chehab wrote:
> > Em Thu, 14 Apr 2016 10:31:20 -0600
> > Shuah Khan <shuahkh@....samsung.com> escreveu:
> >
> >> media_dev alloc error path does kfree when alloc fails. Fix it to not call
> >> kfree when media_dev alloc fails.
> >
> > No need. kfree(NULL) is OK.
>
> Agreed.
>
> >
> > Adding a label inside a conditional block is ugly.
>
> In this case, if label is in normal path, we will see defined, but not
> used warnings when condition isn't defined.
True, but we don't need a label here, as kfree() can be called with a null
pointer.
> We seem to have many such
> cases for CONFIG_MEDIA_CONTROLLER :(
We may try to address those media-controller dependent code latter on.
I have some ideas of adding some macros and helper functions to allow
getting rid of those ifdefs and not add extra code if !MEDIA_CONTROLLER,
but the better seems to first add MC support to ALSA and make the
enable/disable functions generic, and then cleanup the code to remove
those ifdefs.
>
> thanks,
> -- Shuah
>
>
--
Thanks,
Mauro
Powered by blists - more mailing lists