public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM / QOS: Use kcalloc() instead of kzalloc()
@ 2024-01-05 18:11 Erick Archer
  2024-01-05 18:17 ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Erick Archer @ 2024-01-05 18:11 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Gustavo A. R. Silva
  Cc: Erick Archer, linux-pm, linux-kernel, linux-hardening

Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Erick Archer <erick.archer@gmx.com>
---
 drivers/base/power/qos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index 8e93167f1783..bd77f6734f14 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -201,7 +201,7 @@ static int dev_pm_qos_constraints_allocate(struct device *dev)
 	if (!qos)
 		return -ENOMEM;

-	n = kzalloc(3 * sizeof(*n), GFP_KERNEL);
+	n = kcalloc(3, sizeof(*n), GFP_KERNEL);
 	if (!n) {
 		kfree(qos);
 		return -ENOMEM;
--
2.42.0


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

* Re: [PATCH] PM / QOS: Use kcalloc() instead of kzalloc()
  2024-01-05 18:11 [PATCH] PM / QOS: Use kcalloc() instead of kzalloc() Erick Archer
@ 2024-01-05 18:17 ` Gustavo A. R. Silva
  2024-01-09 13:57   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2024-01-05 18:17 UTC (permalink / raw)
  To: Erick Archer, Rafael J. Wysocki, Len Brown, Pavel Machek,
	Greg Kroah-Hartman, Gustavo A. R. Silva
  Cc: linux-pm, linux-kernel, linux-hardening



On 1/5/24 12:11, Erick Archer wrote:
> Use 2-factor multiplication argument form kcalloc() instead
> of kzalloc().
> 
> Link: https://github.com/KSPP/linux/issues/162
> Signed-off-by: Erick Archer <erick.archer@gmx.com>

Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Thanks!
-- 
Gustavo

> ---
>   drivers/base/power/qos.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
> index 8e93167f1783..bd77f6734f14 100644
> --- a/drivers/base/power/qos.c
> +++ b/drivers/base/power/qos.c
> @@ -201,7 +201,7 @@ static int dev_pm_qos_constraints_allocate(struct device *dev)
>   	if (!qos)
>   		return -ENOMEM;
> 
> -	n = kzalloc(3 * sizeof(*n), GFP_KERNEL);
> +	n = kcalloc(3, sizeof(*n), GFP_KERNEL);
>   	if (!n) {
>   		kfree(qos);
>   		return -ENOMEM;
> --
> 2.42.0
> 
> 

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

* Re: [PATCH] PM / QOS: Use kcalloc() instead of kzalloc()
  2024-01-05 18:17 ` Gustavo A. R. Silva
@ 2024-01-09 13:57   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2024-01-09 13:57 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Erick Archer
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Gustavo A. R. Silva, linux-pm, linux-kernel, linux-hardening

On Fri, Jan 5, 2024 at 7:17 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
>
>
> On 1/5/24 12:11, Erick Archer wrote:
> > Use 2-factor multiplication argument form kcalloc() instead
> > of kzalloc().
> >
> > Link: https://github.com/KSPP/linux/issues/162
> > Signed-off-by: Erick Archer <erick.archer@gmx.com>
>
> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Applied as 6.8-rc1 material, thanks!

> > ---
> >   drivers/base/power/qos.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
> > index 8e93167f1783..bd77f6734f14 100644
> > --- a/drivers/base/power/qos.c
> > +++ b/drivers/base/power/qos.c
> > @@ -201,7 +201,7 @@ static int dev_pm_qos_constraints_allocate(struct device *dev)
> >       if (!qos)
> >               return -ENOMEM;
> >
> > -     n = kzalloc(3 * sizeof(*n), GFP_KERNEL);
> > +     n = kcalloc(3, sizeof(*n), GFP_KERNEL);
> >       if (!n) {
> >               kfree(qos);
> >               return -ENOMEM;
> > --
> > 2.42.0
> >
> >

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

end of thread, other threads:[~2024-01-09 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-05 18:11 [PATCH] PM / QOS: Use kcalloc() instead of kzalloc() Erick Archer
2024-01-05 18:17 ` Gustavo A. R. Silva
2024-01-09 13:57   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox