Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932759AbdHVMjJ (ORCPT ); Tue, 22 Aug 2017 08:39:09 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40952 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932609AbdHVMjH (ORCPT ); Tue, 22 Aug 2017 08:39:07 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1A2AD602B3 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sricharan@codeaurora.org Subject: Re: [PATCH 11/18] rpmsg: glink: Use the local intents when receiving data To: Arun Kumar Neelakantam , ohad@wizery.com, bjorn.andersson@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <1502903951-5403-1-git-send-email-sricharan@codeaurora.org> <1502903951-5403-12-git-send-email-sricharan@codeaurora.org> <1dc63580-4a6c-750a-7cb6-00906a4ea4c0@codeaurora.org> From: Sricharan R Message-ID: <65d6412f-ee00-09b1-59ee-7ff20d65827b@codeaurora.org> Date: Tue, 22 Aug 2017 18:09:01 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1dc63580-4a6c-750a-7cb6-00906a4ea4c0@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Antivirus: Avast (VPS 170822-2, 08/22/2017), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1125 Lines: 31 Hi, >>   -    /* Might have an ongoing, fragmented, message to append */ >> -    if (!channel->buf) { >> -        channel->buf = kmalloc(chunk_size + left_size, GFP_ATOMIC); >> -        if (!channel->buf) >> -            return -ENOMEM; >> +    if (glink->intentless) { >> +        /* Might have an ongoing, fragmented, message to append */ >> +        if (!channel->buf) { >> +            intent = kzalloc(sizeof(*intent), GFP_ATOMIC); >> +            if (!intent) >> +                return -ENOMEM; >> + >> +            intent->data = kmalloc(chunk_size + left_size, >> +                           GFP_ATOMIC); > > Who is supposed to free the intent and intent->data memory ? Well, that's done as a part of the rx_done_work. Regards, Sricharan -- "QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus