diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2010-04-05 18:43:18 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-06 19:50:21 -0700 |
commit | 33d8212c4db350652d3991d60405826373fbfd60 (patch) | |
tree | 93fc130e577594b58ad1189ad4e23206bfbf8ad1 /drivers/net/irda | |
parent | ba5d47cf4313e86afe046d402b8cfe7b2bca911d (diff) |
net/irda: sh_sir: Modify iounmap wrong execution
On sh_sir_probe function, there was a possibility that
iounmap is executed even though self->membase was NULL when error case.
This patch modify it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r-- | drivers/net/irda/sh_sir.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c index 761ed012f0bb..7c17ab8ecc29 100644 --- a/drivers/net/irda/sh_sir.c +++ b/drivers/net/irda/sh_sir.c @@ -708,7 +708,6 @@ static int __devinit sh_sir_probe(struct platform_device *pdev) struct sh_sir_self *self; struct resource *res; char clk_name[8]; - void __iomem *base; unsigned int irq; int err = -ENOMEM; @@ -723,14 +722,14 @@ static int __devinit sh_sir_probe(struct platform_device *pdev) if (!ndev) goto exit; - base = ioremap_nocache(res->start, resource_size(res)); - if (!base) { + self = netdev_priv(ndev); + self->membase = ioremap_nocache(res->start, resource_size(res)); + if (!self->membase) { err = -ENXIO; dev_err(&pdev->dev, "Unable to ioremap.\n"); goto err_mem_1; } - self = netdev_priv(ndev); err = sh_sir_init_iobuf(self, IRDA_SKB_MAX_MTU, IRDA_SIR_MAX_FRAME); if (err) goto err_mem_2; @@ -747,7 +746,6 @@ static int __devinit sh_sir_probe(struct platform_device *pdev) ndev->netdev_ops = &sh_sir_ndo; ndev->irq = irq; - self->membase = base; self->ndev = ndev; self->qos.baud_rate.bits &= IR_9600; /* FIXME */ self->qos.min_turn_time.bits = 1; /* 10 ms or more */ |