The notifier must be cleaned up whenever parsing endpoints fails. Do that
to avoid a memory leak in that case.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
sizeof(struct sensor_async_subdev),
cio2_fwnode_parse);
if (ret < 0)
- return ret;
+ goto out;
if (list_empty(&cio2->notifier.asd_list))
return -ENODEV; /* no endpoint */
if (ret) {
dev_err(&cio2->pci_dev->dev,
"failed to register async notifier : %d\n", ret);
- v4l2_async_notifier_cleanup(&cio2->notifier);
+ goto out;
}
+out:
+ if (ret)
+ v4l2_async_notifier_cleanup(&cio2->notifier);
+
return ret;
}