Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 399fbb31 authored by Karthik Anantha Ram's avatar Karthik Anantha Ram Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: sync: Report error if getting sync obj reference fails



If we fail to get reference for a sync object propagate the
error directly, there is no necessity to invoke the sync signal
procedure.

Change-Id: I3799018db58b1bb04114c0fb45a967be89f90f06
Signed-off-by: default avatarKarthik Anantha Ram <kartanan@codeaurora.org>
parent f093458b
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -433,6 +433,7 @@ static int cam_sync_handle_create(struct cam_private_ioctl_arg *k_ioctl)

static int cam_sync_handle_signal(struct cam_private_ioctl_arg *k_ioctl)
{
	int rc = 0;
	struct cam_sync_signal sync_signal;

	if (k_ioctl->size != sizeof(struct cam_sync_signal))
@@ -447,7 +448,14 @@ static int cam_sync_handle_signal(struct cam_private_ioctl_arg *k_ioctl)
		return -EFAULT;

	/* need to get ref for UMD signaled fences */
	cam_sync_get_obj_ref(sync_signal.sync_obj);
	rc = cam_sync_get_obj_ref(sync_signal.sync_obj);
	if (rc) {
		CAM_DBG(CAM_SYNC,
			"Error: cannot signal an uninitialized sync obj = %d",
			sync_signal.sync_obj);
		return rc;
	}

	return cam_sync_signal(sync_signal.sync_obj,
		sync_signal.sync_state);
}