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

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

Merge "soc: qcom: hab: Fix potential memory leak when receiving msg"

parents 86bc9bf1 f5109187
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -163,13 +163,16 @@ static int hab_receive_create_export_ack(struct physical_channel *pchan,
	if (sizebytes > sizeof(ack_recvd->ack)) {
		pr_err("pchan %s read size too large %zd %zd\n",
			pchan->name, sizebytes, sizeof(ack_recvd->ack));
		kfree(ack_recvd);
		return -EINVAL;
	}

	if (physical_channel_read(pchan,
		&ack_recvd->ack,
		sizebytes) != sizebytes)
		sizebytes) != sizebytes) {
		kfree(ack_recvd);
		return -EIO;
	}

	hab_spin_lock(&ctx->expq_lock, irqs_disabled);
	list_add_tail(&ack_recvd->node, &ctx->exp_rxq);