public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale•com>
To: Roel Kluin <12o3l@tiscali•nl>
Cc: linuxppc-dev@ozlabs•org
Subject: Re: inbalanced ioremap/iounmap? in cpm_pic_init(); arch/powerpc/sysdev/commproc.c
Date: Thu, 8 Nov 2007 10:55:08 -0600	[thread overview]
Message-ID: <20071108165508.GB4356@loki.buserror.net> (raw)
In-Reply-To: <473235C6.2050104@tiscali.nl>

On Wed, Nov 07, 2007 at 11:01:42PM +0100, Roel Kluin wrote:
> It appears to me that ioremap/iounmap in cpm_pic_init() is imbalanced. I
> am not certain about this, nor was the patch tested. please review.

You missed several error paths...  and if we're going to clean up the error
handling for this function, we might as well free cpm_pic_host, and do an
of_node_put() before the second of_find_compatible_node(), as well.

> @@ -187,13 +187,15 @@ unsigned int cpm_pic_init(void)
>  		goto end;
>  
>  	if (setup_irq(eirq, &cpm_error_irqaction))
>  		printk(KERN_ERR "Could not allocate CPM error IRQ!");
>  
>  	setbits32(&cpic_reg->cpic_cicr, CICR_IEN);
> -
> +	goto end;
> +io_out:
> +	iounmap(cpic_reg);
>  end:
>  	of_node_put(np);
>  	return sirq;
>  }

Ick.  Maybe better to just duplicate the of_node_put().

-Scott

      reply	other threads:[~2007-11-08 16:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 22:01 inbalanced ioremap/iounmap? in cpm_pic_init(); arch/powerpc/sysdev/commproc.c Roel Kluin
2007-11-08 16:55 ` Scott Wood [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=20071108165508.GB4356@loki.buserror.net \
    --to=scottwood@freescale$(echo .)com \
    --cc=12o3l@tiscali$(echo .)nl \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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