Message ID | 9d0511cd-1fb2-4612-9b21-196a43ad0397@web.de |
---|---|
State | New |
Headers | show |
Series | media: v4l2-fwnode: Improve exception handling in v4l2_fwnode_connector_add_link() | expand |
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 89c7192148df..dc6daf3a9a51 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -744,7 +744,7 @@ int v4l2_fwnode_connector_add_link(struct fwnode_handle *fwnode, link = kzalloc(sizeof(*link), GFP_KERNEL); if (!link) { err = -ENOMEM; - goto err; + goto put_fwnode_ep; } err = v4l2_fwnode_parse_link(connector_ep, &link->fwnode_link); @@ -760,6 +760,7 @@ int v4l2_fwnode_connector_add_link(struct fwnode_handle *fwnode, err: kfree(link); +put_fwnode_ep: fwnode_handle_put(connector_ep); return err;