ChangeSet 1.1992, 2004/09/29 16:28:06-07:00, hare@suse.de [PATCH] Driver Core: Handle NULL arg for put_device() Since get_device() accepts a NULL argument, put_device() should do so, too. Signed-off-by: Hannes Reinecke Signed-off-by: Greg Kroah-Hartman drivers/base/core.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -Nru a/drivers/base/core.c b/drivers/base/core.c --- a/drivers/base/core.c 2004-10-19 09:20:41 -07:00 +++ b/drivers/base/core.c 2004-10-19 09:20:41 -07:00 @@ -293,7 +293,8 @@ */ void put_device(struct device * dev) { - kobject_put(&dev->kobj); + if (dev) + kobject_put(&dev->kobj); }