Skip to content
Commit 439bbd2f authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman
Browse files

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



[ Upstream commit 2b12c136 ]

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: 0874758e ("pinctrl: mcp23s08: Refactor mcp23s08_spi_regmap_init()")
Reported-by: default avatarMartin Hundebøll <martin@geanix.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarMartin Hundebøll <martin@geanix.com>
Link: https://lore.kernel.org/r/20201009180856.4738-1-andriy.shevchenko@linux.intel.com


Tested-by: default avatarJan Kundrát <jan.kundrat@cesnet.cz>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 41836573
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment