diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2010-04-05 14:43:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-06 22:50:21 -0400 |
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) | |||
708 | struct sh_sir_self *self; | 708 | struct sh_sir_self *self; |
709 | struct resource *res; | 709 | struct resource *res; |
710 | char clk_name[8]; | 710 | char clk_name[8]; |
711 | void __iomem *base; | ||
712 | unsigned int irq; | 711 | unsigned int irq; |
713 | int err = -ENOMEM; | 712 | int err = -ENOMEM; |
714 | 713 | ||
@@ -723,14 +722,14 @@ static int __devinit sh_sir_probe(struct platform_device *pdev) | |||
723 | if (!ndev) | 722 | if (!ndev) |
724 | goto exit; | 723 | goto exit; |
725 | 724 | ||
726 | base = ioremap_nocache(res->start, resource_size(res)); | 725 | self = netdev_priv(ndev); |
727 | if (!base) { | 726 | self->membase = ioremap_nocache(res->start, resource_size(res)); |
727 | if (!self->membase) { | ||
728 | err = -ENXIO; | 728 | err = -ENXIO; |
729 | dev_err(&pdev->dev, "Unable to ioremap.\n"); | 729 | dev_err(&pdev->dev, "Unable to ioremap.\n"); |
730 | goto err_mem_1; | 730 | goto err_mem_1; |
731 | } | 731 | } |
732 | 732 | ||
733 | self = netdev_priv(ndev); | ||
734 | err = sh_sir_init_iobuf(self, IRDA_SKB_MAX_MTU, IRDA_SIR_MAX_FRAME); | 733 | err = sh_sir_init_iobuf(self, IRDA_SKB_MAX_MTU, IRDA_SIR_MAX_FRAME); |
735 | if (err) | 734 | if (err) |
736 | goto err_mem_2; | 735 | goto err_mem_2; |
@@ -747,7 +746,6 @@ static int __devinit sh_sir_probe(struct platform_device *pdev) | |||
747 | ndev->netdev_ops = &sh_sir_ndo; | 746 | ndev->netdev_ops = &sh_sir_ndo; |
748 | ndev->irq = irq; | 747 | ndev->irq = irq; |
749 | 748 | ||
750 | self->membase = base; | ||
751 | self->ndev = ndev; | 749 | self->ndev = ndev; |
752 | self->qos.baud_rate.bits &= IR_9600; /* FIXME */ | 750 | self->qos.baud_rate.bits &= IR_9600; /* FIXME */ |
753 | self->qos.min_turn_time.bits = 1; /* 10 ms or more */ | 751 | self->qos.min_turn_time.bits = 1; /* 10 ms or more */ |