From 1630b832355399dd0dc4fcc2cadbcad47153a748 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 15 Dec 2015 09:04:14 -0200 Subject: [PATCH] [media] v4l2-device: fix a missing error code We need to set "err = -ENOMEM" here. Fixes: 38b11f19667a ('[media] v4l2-core: create MC interfaces for devnodes') Signed-off-by: Dan Carpenter Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/v4l2-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c index 2aa72aba4f17..06fa5f1b2cff 100644 --- a/drivers/media/v4l2-core/v4l2-device.c +++ b/drivers/media/v4l2-core/v4l2-device.c @@ -267,8 +267,10 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev) link = media_create_intf_link(&sd->entity, &vdev->intf_devnode->intf, MEDIA_LNK_FL_ENABLED); - if (!link) + if (!link) { + err = -ENOMEM; goto clean_up; + } } #endif sd->devnode = vdev;