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

Commit 2b8648c6 authored by Akhil P Oommen's avatar Akhil P Oommen
Browse files

msm: kgsl: Fix ref counting error for syncsource object



In kgsl_ioctl_syncsource_create_fence(), when the return value is
-ENOMEM or -EBADF, an extra reference count is put back for
syncsource during cleanup. This results in an early free of
syncsource object. This can be fixed by avoiding the extra
kgsl_syncsource_put() during the cleanup.

Change-Id: I4ecbcd04dae6edb773b7979f68c9658a971d9d5d
Signed-off-by: default avatarAkhil P Oommen <akhilpo@codeaurora.org>
parent c95d89c3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 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
@@ -734,6 +734,7 @@ long kgsl_ioctl_syncsource_create_fence(struct kgsl_device_private *dev_priv,
			fput(sync_file->file);
		else if (sfence)
			fence_put(&sfence->fence);
		else
			kgsl_syncsource_put(syncsource);
	}