summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSejun Park <sejun79.park@samsung.com>2017-09-15 18:25:02 +0900
committerSejun Park <sejun79.park@samsung.com>2017-09-18 14:16:30 +0900
commitdbdcb66ed63a6f770944c09afa455bb82fc1393e (patch)
tree20ebc3b7322f09b2fa8ef08e78655b8637dda3e2
parent8ef085211486a4b4198a3c30774819ab9b141c45 (diff)
downloadlibexynos-common-dbdcb66ed63a6f770944c09afa455bb82fc1393e.tar.gz
libexynos-common-dbdcb66ed63a6f770944c09afa455bb82fc1393e.tar.bz2
libexynos-common-dbdcb66ed63a6f770944c09afa455bb82fc1393e.zip
Change-Id: Ic3328b6accdf0760c748783e040aa907fcddc109
-rwxr-xr-xlibv4l2/exynos_mc.c9
1 files 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;