Message ID | 20210120082635.49304-1-bianpan2016@163.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 55a8b42e8645a6dab88674a30cb6ed328e660680 |
Headers | show |
Series | spi: altera: Fix memory leak on error path | expand |
On Wed, 20 Jan 2021 00:26:35 -0800, Pan Bian wrote: > 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
On Wed, 20 Jan 2021, Pan Bian wrote: > 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 <bianpan2016@163.com> Acked-by: Matthew Gerlach <matthew.gerlach@linux.intel.com> > --- > drivers/spi/spi-altera.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c > index cbc4c28c1541..62ea0c9e321b 100644 > --- a/drivers/spi/spi-altera.c > +++ b/drivers/spi/spi-altera.c > @@ -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; > -- > 2.17.1 > >
diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c index cbc4c28c1541..62ea0c9e321b 100644 --- a/drivers/spi/spi-altera.c +++ b/drivers/spi/spi-altera.c @@ -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;
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 <bianpan2016@163.com> --- drivers/spi/spi-altera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)