Commit 0a940b0d authored by Souptick Joarder's avatar Souptick Joarder Committed by Greg Kroah-Hartman
Browse files

serial: ifx6x60: Free memory when probe fails



When spi_setup() fails it doesn't free ifx_dev and we have a memory
leak. Fix this by freeing ifx_dev before the return.

Signed-off-by: default avatarSouptick joarder <jrdr.linux@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7f8b4ebe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1042,6 +1042,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
	ret = spi_setup(spi);
	if (ret) {
		dev_err(&spi->dev, "SPI setup wasn't successful %d", ret);
		kfree(ifx_dev);
		return -ENODEV;
	}