All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/platform/uv: Fix an error code in uv_hubs_init()
@ 2020-12-02 14:44 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2020-12-02 14:44 UTC (permalink / raw)
  To: Justin Ernst
  Cc: Hans de Goede, Mark Gross, Borislav Petkov, Steve Wahl,
	platform-driver-x86, kernel-janitors

Return -ENOMEM on allocation failure instead of returning success.

Fixes: 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/platform/x86/uv_sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c
index 54c342579f1c..e17ce8c4cdad 100644
--- a/drivers/platform/x86/uv_sysfs.c
+++ b/drivers/platform/x86/uv_sysfs.c
@@ -248,6 +248,7 @@ static int uv_hubs_init(void)
 		uv_hubs[i] = kzalloc(sizeof(*uv_hubs[i]), GFP_KERNEL);
 		if (!uv_hubs[i]) {
 			i--;
+			ret = -ENOMEM;
 			goto err_hubs;
 		}
 
-- 
2.29.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] x86/platform/uv: Fix an error code in uv_hubs_init()
@ 2020-12-02 14:44 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2020-12-02 14:44 UTC (permalink / raw)
  To: Justin Ernst
  Cc: Hans de Goede, Mark Gross, Borislav Petkov, Steve Wahl,
	platform-driver-x86, kernel-janitors

Return -ENOMEM on allocation failure instead of returning success.

Fixes: 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/platform/x86/uv_sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c
index 54c342579f1c..e17ce8c4cdad 100644
--- a/drivers/platform/x86/uv_sysfs.c
+++ b/drivers/platform/x86/uv_sysfs.c
@@ -248,6 +248,7 @@ static int uv_hubs_init(void)
 		uv_hubs[i] = kzalloc(sizeof(*uv_hubs[i]), GFP_KERNEL);
 		if (!uv_hubs[i]) {
 			i--;
+			ret = -ENOMEM;
 			goto err_hubs;
 		}
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86/platform/uv: Fix an error code in uv_hubs_init()
  2020-12-02 14:44 ` Dan Carpenter
@ 2020-12-02 19:51   ` Borislav Petkov
  -1 siblings, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2020-12-02 19:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Justin Ernst, Hans de Goede, Mark Gross, Steve Wahl,
	platform-driver-x86, kernel-janitors

On Wed, Dec 02, 2020 at 05:44:07PM +0300, Dan Carpenter wrote:
> Return -ENOMEM on allocation failure instead of returning success.

s/success/random stack memory contents/

-- 
Regards/Gruss,
    Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86/platform/uv: Fix an error code in uv_hubs_init()
@ 2020-12-02 19:51   ` Borislav Petkov
  0 siblings, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2020-12-02 19:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Justin Ernst, Hans de Goede, Mark Gross, Steve Wahl,
	platform-driver-x86, kernel-janitors

On Wed, Dec 02, 2020 at 05:44:07PM +0300, Dan Carpenter wrote:
> Return -ENOMEM on allocation failure instead of returning success.

s/success/random stack memory contents/

-- 
Regards/Gruss,
    Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] x86/platform/uv: Fix an error code in uv_hubs_init()
  2020-12-02 14:44 ` Dan Carpenter
@ 2020-12-02 20:50   ` Ernst, Justin
  -1 siblings, 0 replies; 8+ messages in thread
From: Ernst, Justin @ 2020-12-02 20:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Hans de Goede, Mark Gross, Borislav Petkov, Wahl, Steve,
	platform-driver-x86, kernel-janitors

> Return -ENOMEM on allocation failure instead of returning success.
> 
> Fixes: 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thank you for taking the time to find this.

Reviewed-by: Justin Ernst <justin.ernst@hpe.com> 
(With an acknowledgement of Boris's 's/success/random stack memory contents/' comment)

> ---
>  drivers/platform/x86/uv_sysfs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c
> index 54c342579f1c..e17ce8c4cdad 100644
> --- a/drivers/platform/x86/uv_sysfs.c
> +++ b/drivers/platform/x86/uv_sysfs.c
> @@ -248,6 +248,7 @@ static int uv_hubs_init(void)
>  		uv_hubs[i] = kzalloc(sizeof(*uv_hubs[i]), GFP_KERNEL);
>  		if (!uv_hubs[i]) {
>  			i--;
> +			ret = -ENOMEM;
>  			goto err_hubs;
>  		}
> 
> --
> 2.29.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] x86/platform/uv: Fix an error code in uv_hubs_init()
@ 2020-12-02 20:50   ` Ernst, Justin
  0 siblings, 0 replies; 8+ messages in thread
From: Ernst, Justin @ 2020-12-02 20:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Hans de Goede, Mark Gross, Borislav Petkov, Wahl, Steve,
	platform-driver-x86, kernel-janitors

> Return -ENOMEM on allocation failure instead of returning success.
> 
> Fixes: 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thank you for taking the time to find this.

Reviewed-by: Justin Ernst <justin.ernst@hpe.com> 
(With an acknowledgement of Boris's 's/success/random stack memory contents/' comment)

> ---
>  drivers/platform/x86/uv_sysfs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c
> index 54c342579f1c..e17ce8c4cdad 100644
> --- a/drivers/platform/x86/uv_sysfs.c
> +++ b/drivers/platform/x86/uv_sysfs.c
> @@ -248,6 +248,7 @@ static int uv_hubs_init(void)
>  		uv_hubs[i] = kzalloc(sizeof(*uv_hubs[i]), GFP_KERNEL);
>  		if (!uv_hubs[i]) {
>  			i--;
> +			ret = -ENOMEM;
>  			goto err_hubs;
>  		}
> 
> --
> 2.29.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86/platform/uv: Fix an error code in uv_hubs_init()
  2020-12-02 20:50   ` Ernst, Justin
@ 2020-12-07 10:43     ` Hans de Goede
  -1 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2020-12-07 10:43 UTC (permalink / raw)
  To: Ernst, Justin, Dan Carpenter
  Cc: Mark Gross, Borislav Petkov, Wahl, Steve, platform-driver-x86,
	kernel-janitors

Hi,

On 12/2/20 9:50 PM, Ernst, Justin wrote:
>> Return -ENOMEM on allocation failure instead of returning success.
>>
>> Fixes: 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Thank you for taking the time to find this.
> 
> Reviewed-by: Justin Ernst <justin.ernst@hpe.com> 
> (With an acknowledgement of Boris's 's/success/random stack memory contents/' comment)

ATM the drivers/platform/x86/uv_sysfs.c only exists in the tip/x86 tree -next
branch, so this fix needs to be merged through the tip/x86 tree, here is my ack
for merging it that way:

Acked-by: Hans de Goede <hdegoede@redhat.com>

(either with a fixed up commit-msg as suggested by Borislav, or feel
free to add it to a fixed v2 of the patch)

Regards,

Hans



> 
>> ---
>>  drivers/platform/x86/uv_sysfs.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c
>> index 54c342579f1c..e17ce8c4cdad 100644
>> --- a/drivers/platform/x86/uv_sysfs.c
>> +++ b/drivers/platform/x86/uv_sysfs.c
>> @@ -248,6 +248,7 @@ static int uv_hubs_init(void)
>>  		uv_hubs[i] = kzalloc(sizeof(*uv_hubs[i]), GFP_KERNEL);
>>  		if (!uv_hubs[i]) {
>>  			i--;
>> +			ret = -ENOMEM;
>>  			goto err_hubs;
>>  		}
>>
>> --
>> 2.29.2
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] x86/platform/uv: Fix an error code in uv_hubs_init()
@ 2020-12-07 10:43     ` Hans de Goede
  0 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2020-12-07 10:43 UTC (permalink / raw)
  To: Ernst, Justin, Dan Carpenter
  Cc: Mark Gross, Borislav Petkov, Wahl, Steve, platform-driver-x86,
	kernel-janitors

Hi,

On 12/2/20 9:50 PM, Ernst, Justin wrote:
>> Return -ENOMEM on allocation failure instead of returning success.
>>
>> Fixes: 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Thank you for taking the time to find this.
> 
> Reviewed-by: Justin Ernst <justin.ernst@hpe.com> 
> (With an acknowledgement of Boris's 's/success/random stack memory contents/' comment)

ATM the drivers/platform/x86/uv_sysfs.c only exists in the tip/x86 tree -next
branch, so this fix needs to be merged through the tip/x86 tree, here is my ack
for merging it that way:

Acked-by: Hans de Goede <hdegoede@redhat.com>

(either with a fixed up commit-msg as suggested by Borislav, or feel
free to add it to a fixed v2 of the patch)

Regards,

Hans



> 
>> ---
>>  drivers/platform/x86/uv_sysfs.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c
>> index 54c342579f1c..e17ce8c4cdad 100644
>> --- a/drivers/platform/x86/uv_sysfs.c
>> +++ b/drivers/platform/x86/uv_sysfs.c
>> @@ -248,6 +248,7 @@ static int uv_hubs_init(void)
>>  		uv_hubs[i] = kzalloc(sizeof(*uv_hubs[i]), GFP_KERNEL);
>>  		if (!uv_hubs[i]) {
>>  			i--;
>> +			ret = -ENOMEM;
>>  			goto err_hubs;
>>  		}
>>
>> --
>> 2.29.2
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-07 10:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 14:44 [PATCH] x86/platform/uv: Fix an error code in uv_hubs_init() Dan Carpenter
2020-12-02 14:44 ` Dan Carpenter
2020-12-02 19:51 ` Borislav Petkov
2020-12-02 19:51   ` Borislav Petkov
2020-12-02 20:50 ` Ernst, Justin
2020-12-02 20:50   ` Ernst, Justin
2020-12-07 10:43   ` Hans de Goede
2020-12-07 10:43     ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.