Patch "pinctrl: mcp23s08: Use full chunk of memory for regmap configuration" has been added to the 5.9-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

    pinctrl: mcp23s08: Use full chunk of memory for regmap configuration

to the 5.9-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:
     pinctrl-mcp23s08-use-full-chunk-of-memory-for-regmap.patch
and it can be found in the queue-5.9 subdirectory.

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



commit 9675ee6daca1a5148fa14e5bcaded49584e34696
Author: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Date:   Fri Oct 9 21:08:55 2020 +0300

    pinctrl: mcp23s08: Use full chunk of memory for regmap configuration
    
    [ Upstream commit 2b12c13637134897ba320bd8906a8d918ee7069b ]
    
    It appears that simplification of mcp23s08_spi_regmap_init() made
    a regression due to wrong size calculation for dev_kmemdup() call.
    It misses the fact that config variable is already a pointer, thus
    the sizeof() calculation is wrong and only 4 or 8 bytes were copied.
    
    Fix the parameters to devm_kmemdup() to copy a full chunk of memory.
    
    Fixes: 0874758ecb2b ("pinctrl: mcp23s08: Refactor mcp23s08_spi_regmap_init()")
    Reported-by: Martin Hundebøll <martin@xxxxxxxxxx>
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
    Tested-by: Martin Hundebøll <martin@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20201009180856.4738-1-andriy.shevchenko@xxxxxxxxxxxxxxx
    Tested-by: Jan Kundrát <jan.kundrat@xxxxxxxxx>
    Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pinctrl/pinctrl-mcp23s08_spi.c b/drivers/pinctrl/pinctrl-mcp23s08_spi.c
index 1f47a661b0a79..7c72cffe14127 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08_spi.c
+++ b/drivers/pinctrl/pinctrl-mcp23s08_spi.c
@@ -119,7 +119,7 @@ static int mcp23s08_spi_regmap_init(struct mcp23s08 *mcp, struct device *dev,
 		return -EINVAL;
 	}
 
-	copy = devm_kmemdup(dev, &config, sizeof(config), GFP_KERNEL);
+	copy = devm_kmemdup(dev, config, sizeof(*config), GFP_KERNEL);
 	if (!copy)
 		return -ENOMEM;
 



[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