summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap3isp/ispstat.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2017-07-13 11:23:44 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-05-29 16:39:52 -0400
commit814434984a5d2063ac15d7ff9a46075600ff1805 (patch)
tree8af7d90fa15ffab53c2501df67a6c35c9311ee3d /drivers/media/platform/omap3isp/ispstat.c
parentf42292040d31922ee4e4ea68e2f287fbc3bb2053 (diff)
downloadlinux-814434984a5d2063ac15d7ff9a46075600ff1805.tar.bz2
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 <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/omap3isp/ispstat.c')
-rw-r--r--drivers/media/platform/omap3isp/ispstat.c2
1 files changed, 2 insertions, 0 deletions
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);
}