From 814434984a5d2063ac15d7ff9a46075600ff1805 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Thu, 13 Jul 2017 11:23:44 -0400 Subject: media: omap3isp: Don't rely on devm for memory resource management devm functions are fine for managing resources that are directly related to the device at hand and that have no other dependencies. However, a process holding a file handle to a device created by a driver for a device may result in the file handle left behind after the device is long gone. This will result in accessing released (and potentially reallocated) memory. Instead, manage the memory resources in the driver. Releasing the resources can be later on bound to e.g. by releasing a reference. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/omap3isp/ispstat.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/media/platform/omap3isp/ispstat.c') diff --git a/drivers/media/platform/omap3isp/ispstat.c b/drivers/media/platform/omap3isp/ispstat.c index 953a812bfe5e..46a42c5dc1cc 100644 --- a/drivers/media/platform/omap3isp/ispstat.c +++ b/drivers/media/platform/omap3isp/ispstat.c @@ -1078,4 +1078,6 @@ void omap3isp_stat_cleanup(struct ispstat *stat) mutex_destroy(&stat->ioctl_lock); isp_stat_bufs_free(stat); kfree(stat->buf); + kfree(stat->priv); + kfree(stat->recover_priv); } -- cgit v1.2.3