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

Commit efbe639e authored by wenji's avatar wenji Committed by Gerrit - the friendly Code Review server
Browse files

mcinvoke : Make sure tzhandle is set before f frees



Make sure tzhandle is set before f frees.

Change-Id: I78d87bb37b22c66b008effc86fe7a2ae25b19b76
Signed-off-by: default avatarWenjie Li <quic_wenji@quicinc.com>
parent 1a92bfdd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
 * SMC Invoke driver
 *
 * Copyright (c) 2016-2017,2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
@@ -173,9 +174,9 @@ static int get_fd_from_tzhandle(uint32_t tzhandle, int64_t *fd)
		goto out;

	*fd = unused_fd;
	fd_install(*fd, f);
	((struct smcinvoke_tzobj_context *)
			(f->private_data))->tzhandle = tzhandle;
	fd_install(*fd, f);
	return 0;
out:
	if (unused_fd >= 0)