lkml.org 
[lkml]   [2009]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] ARM: use put_device instead of kfree
Date
If it's not possible to allocate resources for the device, it's better
to call put_device, which will release the device name, instead of
oops'ing with a dev_set_name(&dev, NULL).

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
---
arch/arm/common/sa1111.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index ef12794..8e17608 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -568,8 +568,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
if (ret) {
printk("SA1111: failed to allocate resource for %s\n",
dev->res.name);
- dev_set_name(&dev->dev, NULL);
- kfree(dev);
+ put_device(&dev->dev);
goto out;
}

--
1.6.2.3


\
 
 \ /
  Last update: 2009-04-21 03:15    [W:0.032 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site