Skip to contentSkip to conversation

Patch "clk: bcm: rpi: Use correct order for the parameters of devm_kcalloc()" has been added to the 5.15-stable tree

DISCUSSION Marion & Christophe JAILLET 2 participants 2 messages Sep 6, 2022 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Le 06/09/2022 à 05:28, Sasha Levin a écrit :

Quoted 7 lines

This is a note to let you know that I've just added the patch titled

clk: bcm: rpi: Use correct order for the parameters of devm_kcalloc()

to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 6 lines

The filename of the patch is:
clk-bcm-rpi-use-correct-order-for-the-parameters-of-.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Hi,

I'm not sure that such a patch deserve a backport.

It is correct, but it is just a clean-up that will be a no-op at runtime. Should it help future potential backport, why not, but otherwise, IMHO, it could be dropped.

It is also in the 5.10 backport queue.

Just my 2c,

CJ

Quoted 30 lines

commit f731681dfb26866e5e4130d27d27e00766f7e9d1

Author: Christophe JAILLET <[email protected]>
Date:   Fri May 20 23:20:58 2022 +0200

clk: bcm: rpi: Use correct order for the parameters of devm_kcalloc()

[ Upstream commit b7fa6242f3e035308a76284560e4f918dad9b017 ]

We should have 'n', then 'size', not the opposite.
This is harmless because the 2 values are just multiplied, but having the correct order silence a (unpublished yet) smatch warning.

drivers/clk/bcm/clk-raspberrypi.c +1 -1
index fda78a2f9ac50..97612860ce0e1 100644
@@ -252,7 +252,7 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi,
  	int ret;
 
  	clks = devm_kcalloc(rpi->dev,
-			    sizeof(*clks), RPI_FIRMWARE_NUM_CLK_ID,
+			    RPI_FIRMWARE_NUM_CLK_ID, sizeof(*clks),
  			    GFP_KERNEL);
  	if (!clks)
  		return -ENOMEM;
maintainer
#2 lore raw
Quoted 16 lines · Marion & Christophe JAILLET

Le 06/09/2022 à 05:28, Sasha Levin a écrit :

Quoted 7 lines

This is a note to let you know that I've just added the patch titled

clk: bcm: rpi: Use correct order for the parameters of devm_kcalloc()

to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 6 lines

The filename of the patch is:
clk-bcm-rpi-use-correct-order-for-the-parameters-of-.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 8 lines

Hi,

I'm not sure that such a patch deserve a backport.

It is correct, but it is just a clean-up that will be a no-op at runtime. Should it help future potential backport, why not, but otherwise, IMHO, it could be dropped.

It is also in the 5.10 backport queue.

You're very much correct, it's only there for the benefit of bc163555603e ("clk: bcm: rpi: Prevent out-of-bounds access") which follows it :)

Signature · 2 lines
Thanks,
Sasha