From dbdcb66ed63a6f770944c09afa455bb82fc1393e Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Fri, 15 Sep 2017 18:25:02 +0900 Subject: fixed svace issue Change-Id: Ic3328b6accdf0760c748783e040aa907fcddc109 --- libv4l2/exynos_mc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libv4l2/exynos_mc.c b/libv4l2/exynos_mc.c index 4c12b1f..50aeea8 100755 --- a/libv4l2/exynos_mc.c +++ b/libv4l2/exynos_mc.c @@ -191,10 +191,6 @@ static int __media_get_devname_sysfs(struct media_entity *entity) static int __media_get_media_fd(const char *filename, struct media_device *media) { - ssize_t num; - int media_node; - char *ptr; - ALOGD("%s: %s", __func__, filename); media->fd = open(filename, O_RDWR, 0); @@ -221,6 +217,11 @@ static int __media_enum_entities(struct media_device *media) size = (media->entities_count + 1) * sizeof(*media->entities); media->entities = (struct media_entity*)realloc(media->entities, size); + if (media->entities == NULL) { + ret = -ENOMEM; + break; + } + entity = &media->entities[media->entities_count]; memset(entity, 0, sizeof(*entity)); entity->fd = -1; -- cgit v1.2.3