[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <20180109143755.16931-1-sxwjean@me.com>
Date: Tue, 09 Jan 2018 22:37:55 +0800
From: Xiongwei Song <sxwjean@...com>
To: linux@...linux.org.uk, rafael.j.wysocki@...el.com,
ulf.hansson@...aro.org
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
sxwjean@...il.com
Subject: [PATCH] ARM: locomo: fix free dev incorrectly
In function locomo_init_one_child, If kzalloc call is failed for dev we
would goto out label, then call kfree for dev, however, dev is NULL, we
shouldn't do this.
Signed-off-by: Xiongwei Song <sxwjean@...com>
---
arch/arm/common/locomo.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 51936bde1eb2..fb21b5ade391 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -256,10 +256,9 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
NO_IRQ : lchip->irq_base + info->irq[0];
ret = device_register(&dev->dev);
- if (ret) {
- out:
+ if (ret)
kfree(dev);
- }
+ out:
return ret;
}
--
2.15.1
Powered by blists - more mailing lists