linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: altera: Fix memory leak on error path
@ 2021-01-20  8:26 Pan Bian
  2021-01-20  8:35 ` Xu Yilun
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Pan Bian @ 2021-01-20  8:26 UTC (permalink / raw)
  To: Mark Brown, Xu Yilun, Matthew Gerlach, Tom Rix, Wu Hao
  Cc: linux-spi, linux-kernel, 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 <bianpan2016@163.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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-21 18:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20  8:26 [PATCH] spi: altera: Fix memory leak on error path Pan Bian
2021-01-20  8:35 ` Xu Yilun
2021-01-20 15:03 ` Tom Rix
2021-01-21  0:08 ` Mark Brown
2021-01-21 18:07 ` matthew.gerlach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).