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

Commit 6ec7604a authored by Sachin Bhayare's avatar Sachin Bhayare Committed by Gerrit - the friendly Code Review server
Browse files

msm: Allocate fd with O_CLOEXEC flag



(cherry-pick from 'commit 580ec70acac4 ("fbdev: msm: Allocate fd
 with O_CLOEXEC flag")') and made similar changes
for MDP3.

When fd is requested during get_metadata call, create
fd using O_CLOEXEC flag.

Change-Id: Iaa55927ac04b019ea45fbdfe9c64b10d1f0e3ceb
Signed-off-by: default avatarNirmal Abraham <nabrah@codeaurora.org>
Signed-off-by: default avatarSachin Bhayare <sachin.bhayare@codeaurora.org>
parent 8be2cbed
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-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
@@ -1563,9 +1563,10 @@ static int mdp3_get_metadata(struct msm_fb_data_type *mfd,
		}
		break;
	case metadata_op_get_ion_fd:
		if (mfd->fb_ion_handle) {
		if (mfd->fb_ion_handle && mfd->fb_ion_client) {
			metadata->data.fbmem_ionfd =
					dma_buf_fd(mfd->fbmem_buf, 0);
				ion_share_dma_buf_fd(mfd->fb_ion_client,
					mfd->fb_ion_handle);
			if (metadata->data.fbmem_ionfd < 0)
				pr_err("fd allocation failed. fd = %d\n",
						metadata->data.fbmem_ionfd);