[PATCH] ARM: locomo: fix free dev incorrectly

2018-01-09 Thread Xiongwei Song
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 --- arch/arm/common/locomo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

[PATCH] ARM: locomo: fix free dev incorrectly

2018-01-09 Thread Xiongwei Song
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 --- arch/arm/common/locomo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

Re: [PATCH] ARM: locomo: fix free dev incorrectly

2018-01-09 Thread Russell King - ARM Linux
On Tue, Jan 09, 2018 at 10:37:55PM +0800, Xiongwei Song wrote: > 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. kfree() internally checks for NULL pointers so callers don't have

Re: [PATCH] ARM: locomo: fix free dev incorrectly

2018-01-09 Thread Russell King - ARM Linux
On Tue, Jan 09, 2018 at 10:37:55PM +0800, Xiongwei Song wrote: > 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. kfree() internally checks for NULL pointers so callers don't have