From 09857e35cdccf2457bb03c6d7595adc210a517cc Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 21 May 2008 18:21:38 -0400 Subject: Firmware: fix typo in example code It's not like this stuff even builds right now, but this will make Randy's scripts happy :) Cc: Randy Dunlap Signed-off-by: Greg Kroah-Hartman --- samples/firmware_class/firmware_sample_firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'samples') diff --git a/samples/firmware_class/firmware_sample_firmware_class.c b/samples/firmware_class/firmware_sample_firmware_class.c index 9392116e47b..e6cf7a43a29 100644 --- a/samples/firmware_class/firmware_sample_firmware_class.c +++ b/samples/firmware_class/firmware_sample_firmware_class.c @@ -124,7 +124,7 @@ static int fw_setup_class_device(struct class_device *class_dev, class_dev->class_id[BUS_ID_SIZE-1] = '\0'; class_dev->dev = device; - class_dev->class = &firmware_class, + class_dev->class = &firmware_class; class_set_devdata(class_dev, fw_priv); retval = class_device_register(class_dev); if (retval) { -- cgit v1.2.3 From 185000fc556372b7fb7f26516c325f212030dbd3 Mon Sep 17 00:00:00 2001 From: Li Zefan Date: Fri, 13 Jun 2008 11:09:16 +0800 Subject: kobject: should use kobject_put() in kset-example We should call kobject_put() instead of kfree() if kobject_init_and_add() returns an error, shouldn't we? Don't set up a bad example ;) Signed-off-by: Li Zefan Signed-off-by: Greg Kroah-Hartman --- samples/kobject/kset-example.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'samples') diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c index b0a1b4fe658..7395c0bbae1 100644 --- a/samples/kobject/kset-example.c +++ b/samples/kobject/kset-example.c @@ -211,7 +211,7 @@ static struct foo_obj *create_foo_obj(const char *name) */ retval = kobject_init_and_add(&foo->kobj, &foo_ktype, NULL, "%s", name); if (retval) { - kfree(foo); + kobject_put(&foo->kobj); return NULL; } -- cgit v1.2.3