Removed access to the garbage value that has not been initialized.
Change-Id: Ib71f05656bc59b135fae523f450ae5102e258023
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
static struct marucam_framebuffer *framebuffer;
static const char *dev_name = "/dev/video0";
-static int v4l2_fd;
+static int v4l2_fd = -1;
static int convert_trial;
static int ready_count;
static int timeout_n;
void marucam_device_init(MaruCamState *state)
{
state->destroying = false;
+ memset(&saved_frame, 0x00, sizeof(saved_frame));
+
qemu_thread_create(&state->thread_id,
MARUCAM_THREAD_NAME,
marucam_worker_thread,
}
memset(&saved_frame, 0x00, sizeof(saved_frame));
- v4l2_close(v4l2_fd);
- v4l2_fd = 0;
+ if (v4l2_fd >= 0) {
+ v4l2_close(v4l2_fd);
+ v4l2_fd = -1;
+ }
INFO("Closed\n");
}