提交 33d8212c 编写于 作者: K Kuninori Morimoto 提交者: David S. Miller

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: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ba5d47cf
...@@ -708,7 +708,6 @@ static int __devinit sh_sir_probe(struct platform_device *pdev) ...@@ -708,7 +708,6 @@ static int __devinit sh_sir_probe(struct platform_device *pdev)
struct sh_sir_self *self; struct sh_sir_self *self;
struct resource *res; struct resource *res;
char clk_name[8]; char clk_name[8];
void __iomem *base;
unsigned int irq; unsigned int irq;
int err = -ENOMEM; int err = -ENOMEM;
...@@ -723,14 +722,14 @@ static int __devinit sh_sir_probe(struct platform_device *pdev) ...@@ -723,14 +722,14 @@ static int __devinit sh_sir_probe(struct platform_device *pdev)
if (!ndev) if (!ndev)
goto exit; goto exit;
base = ioremap_nocache(res->start, resource_size(res)); self = netdev_priv(ndev);
if (!base) { self->membase = ioremap_nocache(res->start, resource_size(res));
if (!self->membase) {
err = -ENXIO; err = -ENXIO;
dev_err(&pdev->dev, "Unable to ioremap.\n"); dev_err(&pdev->dev, "Unable to ioremap.\n");
goto err_mem_1; goto err_mem_1;
} }
self = netdev_priv(ndev);
err = sh_sir_init_iobuf(self, IRDA_SKB_MAX_MTU, IRDA_SIR_MAX_FRAME); err = sh_sir_init_iobuf(self, IRDA_SKB_MAX_MTU, IRDA_SIR_MAX_FRAME);
if (err) if (err)
goto err_mem_2; goto err_mem_2;
...@@ -747,7 +746,6 @@ static int __devinit sh_sir_probe(struct platform_device *pdev) ...@@ -747,7 +746,6 @@ static int __devinit sh_sir_probe(struct platform_device *pdev)
ndev->netdev_ops = &sh_sir_ndo; ndev->netdev_ops = &sh_sir_ndo;
ndev->irq = irq; ndev->irq = irq;
self->membase = base;
self->ndev = ndev; self->ndev = ndev;
self->qos.baud_rate.bits &= IR_9600; /* FIXME */ self->qos.baud_rate.bits &= IR_9600; /* FIXME */
self->qos.min_turn_time.bits = 1; /* 10 ms or more */ self->qos.min_turn_time.bits = 1; /* 10 ms or more */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册