projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f8b4eb
)
serial: ifx6x60: Free memory when probe fails
author
Souptick Joarder
<jrdr.linux@gmail.com>
Fri, 28 Oct 2016 12:00:16 +0000
(17:30 +0530)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 13:50:46 +0000
(14:50 +0100)
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: Souptick joarder <jrdr.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/ifx6x60.c
patch
|
blob
|
history
diff --git
a/drivers/tty/serial/ifx6x60.c
b/drivers/tty/serial/ifx6x60.c
index d386346248deba5026224d590b6be60fe5a2af91..157883653256da9ebeae89d7dabead3285656c82 100644
(file)
--- a/
drivers/tty/serial/ifx6x60.c
+++ b/
drivers/tty/serial/ifx6x60.c
@@
-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;
}