diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2019-09-23 06:09:46 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-10-01 17:32:55 -0300 |
commit | 355047f411c0516533b8c9c96eb6cea252bc78f0 (patch) | |
tree | 5c522cca920fe894cfaa0f3b9cd145202ea2be47 /drivers/media/v4l2-core | |
parent | 8f4ac27af9d61776ee7218175ce300c2cb6a7121 (diff) | |
download | linux-355047f411c0516533b8c9c96eb6cea252bc78f0.tar.bz2 |
media: v4l: fwnode: Make v4l2_fwnode_endpoint_free() safer
Assign vep->link_frequencies to NULL after releasing its memory. Without
this change, multiple calls to v4l2_fwnode_endpoint_free() would result in
double kfree calls.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-fwnode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 3bd1888787eb..192cac076761 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -512,6 +512,7 @@ void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep) return; kfree(vep->link_frequencies); + vep->link_frequencies = NULL; } EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_free); |