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

Commit 125d16b7 authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian
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>
Signed-off-by: default avatarJeyaprakash Soundrapandian <jsoundra@codeaurora.org>
parent 3b3e314b
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/init.h>
@@ -426,6 +426,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))
@@ -440,7 +441,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);
}