public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jaroslav Kysela <perex@perex.cz>,
	Himangi Saraogi <himangi774@gmail.com>,
	alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] sound: oss: uart401: remove unneeded NULL check
Date: Sat, 22 Nov 2014 20:49:29 +0000	[thread overview]
Message-ID: <s5hy4r39d0m.wl-tiwai@suse.de> (raw)
In-Reply-To: <20141122182901.GA6994@mwanda>

At Sat, 22 Nov 2014 21:29:01 +0300,
Dan Carpenter wrote:
> 
> "devc" can't be NULL here so there is no need to check.  Also I removed
> the "devc = NULL" assignment because devc is stored on stack so it's
> a no-op.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied.


Takashi

> 
> diff --git a/sound/oss/uart401.c b/sound/oss/uart401.c
> index 279bc56..dae4d43 100644
> --- a/sound/oss/uart401.c
> +++ b/sound/oss/uart401.c
> @@ -412,13 +412,10 @@ void unload_uart401(struct address_info *hw_config)
>  
>  	if (!devc->share_irq)
>  		free_irq(devc->irq, devc);
> -	if (devc)
> -	{
> -		kfree(midi_devs[devc->my_dev]->converter);
> -		kfree(midi_devs[devc->my_dev]);
> -		kfree(devc);
> -		devc = NULL;
> -	}
> +	kfree(midi_devs[devc->my_dev]->converter);
> +	kfree(midi_devs[devc->my_dev]);
> +	kfree(devc);
> +
>  	/* This kills midi_devs[x] */
>  	sound_unload_mididev(hw_config->slots[4]);
>  }
> 

      reply	other threads:[~2014-11-22 20:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-22 18:29 [patch] sound: oss: uart401: remove unneeded NULL check Dan Carpenter
2014-11-22 20:49 ` Takashi Iwai [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=s5hy4r39d0m.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.carpenter@oracle.com \
    --cc=himangi774@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=perex@perex.cz \
    /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