Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936196AbZFPFxr (ORCPT ); Tue, 16 Jun 2009 01:53:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758982AbZFPFvA (ORCPT ); Tue, 16 Jun 2009 01:51:00 -0400 Received: from kroah.org ([198.145.64.141]:48318 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761471AbZFPFu7 (ORCPT ); Tue, 16 Jun 2009 01:50:59 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Dave Young , Greg Kroah-Hartman Subject: [PATCH 11/64] driver-core: make sysdev_class_register check kobject_set_name return value Date: Mon, 15 Jun 2009 22:46:00 -0700 Message-Id: <1245131213-24168-11-git-send-email-gregkh@suse.de> X-Mailer: git-send-email 1.6.3.1 In-Reply-To: <20090616051351.GA23627@kroah.com> References: <20090616051351.GA23627@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1345 Lines: 46 From: Dave Young sysdev_class_register should check the kobject_set_name return value. Add the return value checking code. Signed-off-by: Dave Young Signed-off-by: Greg Kroah-Hartman --- drivers/base/sys.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 9742a78..162355c 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -131,6 +131,8 @@ static struct kset *system_kset; int sysdev_class_register(struct sysdev_class *cls) { + int retval; + pr_debug("Registering sysdev class '%s'\n", cls->name); INIT_LIST_HEAD(&cls->drivers); @@ -138,7 +140,11 @@ int sysdev_class_register(struct sysdev_class *cls) cls->kset.kobj.parent = &system_kset->kobj; cls->kset.kobj.ktype = &ktype_sysdev_class; cls->kset.kobj.kset = system_kset; - kobject_set_name(&cls->kset.kobj, cls->name); + + retval = kobject_set_name(&cls->kset.kobj, cls->name); + if (retval) + return retval; + return kset_register(&cls->kset); } -- 1.6.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/