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>
This commit is contained in:
parent
8f4ac27af9
commit
355047f411
@ -512,6 +512,7 @@ void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
kfree(vep->link_frequencies);
|
kfree(vep->link_frequencies);
|
||||||
|
vep->link_frequencies = NULL;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_free);
|
EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_free);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user