spi: altera: Fix memory leak on error path
PATCH 1/1 spi: altera: Fix memory leak on error path
Release master that have been previously allocated if the number of chipselect is invalid.
--- drivers/spi/spi-altera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/spi-altera.c +2 -1
@@ -254,7 +254,8 @@ static int altera_spi_probe(struct platform_device *pdev)dev_err (&pdev->dev,"Invalid number of chipselect: %hu\n" , pdata->num_chipselect); -return -EINVAL ; + err = -EINVAL ; + goto exit; } master->num_chipselect = pdata->num_chipselect;
Signature · 1 line
2.17.1
Quoted 14 lines · Pan Bian
Release master that have been previously allocated if the number of chipselect is invalid.
Fixes 8e04187c1bc7 ("spi: altera: add SPI core parameters support via platform data.")Signed-off-by Pan Bian <[email protected]>--- drivers/spi/spi-altera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/spi/spi-altera.c +0
-0
drivers/spi/spi-altera.c static int altera_spi_probe(struct platform_device *pdev) · line 258
Quoted 6 lines
drivers/spi/spi-altera.c +2
-1@@ -254,7 +254,8 @@ static int altera_spi_probe(struct platform_device *pdev)dev_err (&pdev->dev,"Invalid number of chipselect: %hu\n" , pdata->num_chipselect); -return -EINVAL ; + err = -EINVAL ; + goto exit;
Thanks for the fix. Looks good to me.
Yilun
Quoted 14 lines · Pan Bian
Release master that have been previously allocated if the number of chipselect is invalid.
Fixes 8e04187c1bc7 ("spi: altera: add SPI core parameters support via platform data.")Signed-off-by Pan Bian <[email protected]>--- drivers/spi/spi-altera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/spi/spi-altera.c +0
-0
drivers/spi/spi-altera.c static int altera_spi_probe(struct platform_device *pdev) · line 261
Quoted 9 lines
drivers/spi/spi-altera.c +2
-1@@ -254,7 +254,8 @@ static int altera_spi_probe(struct platform_device *pdev)dev_err (&pdev->dev,"Invalid number of chipselect: %hu\n" , pdata->num_chipselect); -return -EINVAL ; + err = -EINVAL ; + goto exit; } master->num_chipselect = pdata->num_chipselect;
Mark Brown
maintainerQuoted 2 lines · Pan Bian
Release master that have been previously allocated if the number of chipselect is invalid.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: altera: Fix memory leak on error path
commit: 55a8b42e8645a6dab88674a30cb6ed328e660680
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 5 lines · Pan Bian
Release master that have been previously allocated if the number of chipselect is invalid.
Fixes 8e04187c1bc7 ("spi: altera: add SPI core parameters support via platform data.")Signed-off-by Pan Bian <[email protected]>
Quoted 22 lines
---
drivers/spi/spi-altera.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)drivers/spi/spi-altera.c +2
-1@@ -254,7 +254,8 @@ static int altera_spi_probe(struct platform_device *pdev)dev_err (&pdev->dev,"Invalid number of chipselect: %hu\n" , pdata->num_chipselect); -return -EINVAL ; + err = -EINVAL ; + goto exit; } master->num_chipselect = pdata->num_chipselect;Signature · 1 line
2.17.1