We missed freeing intent and intent->data on error conditions. Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@xxxxxxxxx> --- drivers/rpmsg/qcom_glink_native.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 5a5e927..2e64c4d 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -640,13 +640,17 @@ qcom_glink_alloc_intent(struct qcom_glink *glink, return NULL; intent->data = kzalloc(size, GFP_KERNEL); - if (!intent->data) + if (!intent->data) { + kfree(intent); return NULL; + } spin_lock_irqsave(&channel->intent_lock, flags); ret = idr_alloc_cyclic(&channel->liids, intent, 1, -1, GFP_ATOMIC); if (ret < 0) { spin_unlock_irqrestore(&channel->intent_lock, flags); + kfree(intent->data); + kfree(intent); return NULL; } spin_unlock_irqrestore(&channel->intent_lock, flags); -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html