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

Commit 0cc3c2ff authored by Yong Ding's avatar Yong Ding Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: hab: initialize the hab_message pointer as NULL



The had_message pointer should be initialized as NULL before
calling hab_vchan_recv(). Furtherly, inside the hab_vchan_recv(),
it is good to also clear it as NULL when the virtual channel
is not found. Then there is such guarantee by both the caller
and the callee.

Change-Id: Id8c46e1828fb3af0c42a9f59f68148717c511e6e
Signed-off-by: default avatarYong Ding <yongding@codeaurora.org>
parent 61d654d3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -612,6 +612,7 @@ int hab_vchan_recv(struct uhab_context *ctx,
	vchan = hab_get_vchan_fromvcid(vcid, ctx, 1);
	if (!vchan) {
		pr_err("vcid %X vchan 0x%pK ctx %pK\n", vcid, vchan, ctx);
		*message = NULL;
		return -ENODEV;
	}

+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ int32_t habmm_socket_recv(int32_t handle, void *dst_buff, uint32_t *size_bytes,
		uint32_t timeout, uint32_t flags)
{
	int ret = 0;
	struct hab_message *msg;
	struct hab_message *msg = NULL;

	if (!size_bytes || !dst_buff)
		return -EINVAL;