public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: amba: Fix leak of driver_override attribute value
@ 2018-09-19 23:47 Trent Piepho
  2018-09-20  6:48 ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Trent Piepho @ 2018-09-19 23:47 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org
  Cc: Trent Piepho, Russell King, Todd Kjos, Geert Uytterhoeven,
	Greg Kroah-Hartman

If driver_override was set when a device was released the string would
not be kfree'ed in amba_device_release and thus leaked when the amba
device was freed.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Todd Kjos <tkjos@google.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Trent Piepho <tpiepho@impinj.com>
---
 drivers/amba/bus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 41b706403ef7..ff3cb96526bc 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -347,6 +347,7 @@ static void amba_device_release(struct device *dev)
 
 	if (d->res.parent)
 		release_resource(&d->res);
+	kfree(d->driver_override);
 	kfree(d);
 }
 
-- 
2.14.4


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

end of thread, other threads:[~2018-09-20  7:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-19 23:47 [PATCH] ARM: amba: Fix leak of driver_override attribute value Trent Piepho
2018-09-20  6:48 ` Geert Uytterhoeven
2018-09-20  7:09   ` Greg KH
2018-09-20  7:16     ` Geert Uytterhoeven
2018-09-20  7:24       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox