public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Shuah Khan <shuah.kh@samsung.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>, <nenggun.kim@samsung.com>,
	<akpm@linux-foundation.org>, <jh1009.sung@samsung.com>,
	<inki.dae@samsung.com>, <arnd@arndb.de>,
	<linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: saa7134 fix media_dev alloc error path to not free when alloc fails
Date: Fri, 15 Apr 2016 06:47:47 -0300	[thread overview]
Message-ID: <20160415064747.2735370d@recife.lan> (raw)
In-Reply-To: <57101729.1030909@samsung.com>

Em Thu, 14 Apr 2016 16:18:17 -0600
Shuah Khan <shuah.kh@samsung.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@osg.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

      reply	other threads:[~2016-04-15  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 16:31 [PATCH] media: saa7134 fix media_dev alloc error path to not free when alloc fails Shuah Khan
2016-04-14 21:08 ` Mauro Carvalho Chehab
2016-04-14 22:18   ` Shuah Khan
2016-04-15  9:47     ` Mauro Carvalho Chehab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160415064747.2735370d@recife.lan \
    --to=mchehab@osg.samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=inki.dae@samsung.com \
    --cc=jh1009.sung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=nenggun.kim@samsung.com \
    --cc=shuah.kh@samsung.com \
    --cc=shuahkh@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox