2014-06-17 14:26:57

by Jeff Liu

[permalink] [raw]
Subject: [PATCH 02/24] sample/kobject: update kset-example code

From: Jie Liu <[email protected]>
Subject: sample/kobject: update kset-example code

Check and return the error ptr if call kset_create_and_add() failed

Cc: Christoph Lameter <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Jie Liu <[email protected]>
---
samples/kobject/kset-example.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index ab5e447..c2911d9 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -238,8 +238,8 @@ static int __init example_init(void)
* located under /sys/kernel/
*/
example_kset = kset_create_and_add("kset_example", NULL, kernel_kobj);
- if (!example_kset)
- return -ENOMEM;
+ if (IS_ERR(example_kset))
+ return PTR_ERR(example_kset);

/*
* Create three objects and register them with our kset
--
1.8.3.2


2014-06-17 19:19:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 02/24] sample/kobject: update kset-example code

On Tue, Jun 17, 2014 at 10:26:47PM +0800, Jeff Liu wrote:
> From: Jie Liu <[email protected]>
> Subject: sample/kobject: update kset-example code
>
> Check and return the error ptr if call kset_create_and_add() failed
>
> Cc: Christoph Lameter <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Signed-off-by: Jie Liu <[email protected]>
> ---
> samples/kobject/kset-example.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Nope, not taking this, sorry.

greg k-h

Subject: Re: [PATCH 02/24] sample/kobject: update kset-example code

On Tue, 17 Jun 2014, Greg KH wrote:

> On Tue, Jun 17, 2014 at 10:26:47PM +0800, Jeff Liu wrote:
> > From: Jie Liu <[email protected]>
> > Subject: sample/kobject: update kset-example code
> >
> > Check and return the error ptr if call kset_create_and_add() failed
> >
> > Cc: Christoph Lameter <[email protected]>
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: Andrew Morton <[email protected]>
> > Signed-off-by: Jie Liu <[email protected]>
> > ---
> > samples/kobject/kset-example.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Nope, not taking this, sorry.

Ok. I will then accept the first patch to slub.c that you sent which
simply returns -ENOMEM. Please resend that one.