mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
Merge "soc: qcom: hab: Fix potential memory leak when receiving msg"
This commit is contained in:
commit
b8bf0ad232
1 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue