Patch "gpio: sim: Use correct order for the parameters of devm_kcalloc()" has been added to the 5.18-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    gpio: sim: Use correct order for the parameters of devm_kcalloc()

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

The filename of the patch is:
     gpio-sim-use-correct-order-for-the-parameters-of-dev.patch
and it can be found in the queue-5.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3e43e85f99a5eeb45a0c56abf7508f5694dcdad8
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Fri May 20 21:21:56 2022 +0200

    gpio: sim: Use correct order for the parameters of devm_kcalloc()
    
    [ Upstream commit c680c6a814a2269427fad9ac417ab16756bceae9 ]
    
    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.
    
    Fixes: cb8c474e79be ("gpio: sim: new testing module")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
    Signed-off-by: Bartosz Golaszewski <brgl@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
index 41c31b10ae84..98109839102f 100644
--- a/drivers/gpio/gpio-sim.c
+++ b/drivers/gpio/gpio-sim.c
@@ -314,8 +314,8 @@ static int gpio_sim_setup_sysfs(struct gpio_sim_chip *chip)
 
 	for (i = 0; i < num_lines; i++) {
 		attr_group = devm_kzalloc(dev, sizeof(*attr_group), GFP_KERNEL);
-		attrs = devm_kcalloc(dev, sizeof(*attrs),
-				     GPIO_SIM_NUM_ATTRS, GFP_KERNEL);
+		attrs = devm_kcalloc(dev, GPIO_SIM_NUM_ATTRS, sizeof(*attrs),
+				     GFP_KERNEL);
 		val_attr = devm_kzalloc(dev, sizeof(*val_attr), GFP_KERNEL);
 		pull_attr = devm_kzalloc(dev, sizeof(*pull_attr), GFP_KERNEL);
 		if (!attr_group || !attrs || !val_attr || !pull_attr)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux