lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <53A04FF7.5050900@oracle.com>
Date:	Tue, 17 Jun 2014 22:25:59 +0800
From:	Jeff Liu <jeff.liu@...cle.com>
To:	gregkh@...uxfoundation.org
CC:	Christoph Lameter <cl@...two.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Pekka Enberg <penberg@...nel.org>,
	Matt Mackall <mpm@...enic.com>, benh@...nel.crashing.org,
	paulus@...ba.org, schwidefsky@...ibm.com,
	heiko.carstens@...ibm.com, herbert@...dor.apana.org.au,
	davem@...emloft.net, stefanr@...6.in-berlin.de, joro@...tes.org,
	jejb@...isc-linux.org, deller@....de, bhelgaas@...gle.com,
	clm@...com, Josef Bacik <jbacik@...com>, swhiteho@...hat.com,
	bharrosh@...asas.com, bhalevy@...marydata.com, ccaulfie@...hat.com,
	teigland@...hat.com, "Theodore Ts'o" <tytso@....edu>,
	adilger.kernel@...ger.ca, jaegeuk@...nel.org,
	cm224.lee@...sung.com, Mark Fasheh <mfasheh@...e.com>,
	Joel Becker <jlbec@...lplan.org>, casey@...aufler-ca.com,
	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 01/24] kobject: return actual error on kset_create_and_add

From: Jie Liu <jeff.liu@...cle.com>

It's better to return the actual error rather than NULL because
kset_register() can failed due to other reasons.

Cc: Christoph Lameter <cl@...ux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Pekka Enberg <penberg@...nel.org>
Cc: Matt Mackall <mpm@...enic.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
Cc: Heiko Carstens <heiko.carstens@...ibm.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>
Cc: David S. Miller <davem@...emloft.net>
Cc: Stefan Richter <stefanr@...6.in-berlin.de>
Cc: Joerg Roedel <joro@...tes.org>
Cc: James E.J. Bottomley <JBottomley@...allels.com>
Cc: Helge Deller <deller@....de>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Chris Mason <clm@...com>
Cc: Josef Bacik <jbacik@...com>
Cc: Steven Whitehouse <swhiteho@...hat.com>
Cc: Boaz Harrosh <bharrosh@...asas.com>
Cc: Benny Halevy <bhalevy@...marydata.com>
Cc: Christine Caulfield <ccaulfie@...hat.com>
Cc: David Teigland <teigland@...hat.com>
Cc: Theodore Ts'o <tytso@....edu>
Cc: Andreas Dilger <adilger.kernel@...ger.ca>
Cc: Jaegeuk Kim <jaegeuk@...nel.org>
Cc: Changman Lee <cm224.lee@...sung.com>
Cc: Mark Fasheh <mfasheh@...e.com>
Cc: Joel Becker <jlbec@...lplan.org>
Cc: Casey Schaufler <casey@...aufler-ca.com>
Signed-off-by: Jie Liu <jeff.liu@...cle.com>
---
 lib/kobject.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/kobject.c b/lib/kobject.c
index 58751bb..538c617 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -919,11 +919,11 @@ struct kset *kset_create_and_add(const char *name,
 
 	kset = kset_create(name, uevent_ops, parent_kobj);
 	if (!kset)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 	error = kset_register(kset);
 	if (error) {
 		kfree(kset);
-		return NULL;
+		return ERR_PTR(error);
 	}
 	return kset;
 }
-- 
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ