Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1244742imm; Fri, 11 May 2018 13:18:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp8JYnEDXGTd2OywYlM48m3mm+1Sl6rSZ/RmaEK3jcAOCluEzGfhV9Ey88szOWu+MT7pcqR X-Received: by 2002:a63:7453:: with SMTP id e19-v6mr363003pgn.87.1526069894795; Fri, 11 May 2018 13:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526069894; cv=none; d=google.com; s=arc-20160816; b=g4T5X/QPhWbuedyKGIMvLl7S+MOfiwf5qzylbL2MYLPZ8kcgEXA/jlb+mYltSTUbgW 8FIwhiycPo4wCKgsbKbspdiktgNHNb4RER0qYevMUzxWgzYvxBpjfv9qHx1qbOPnsTy4 C5+FcuXDSqov95Uoy3o/Z5vdEyJKKYKt2oHs5rilvwCkMpzq3/ZU7VB1RUreHnZwrBnY AtW+O5e0JuTQCnJTebphNtqSeFl3w19RFCKyxlQUNsmlp2gtBOuO2El1XJxFidRGiw6N VOoM/ocCzOVsmkBp/dIKi+t426LzSxG8j5Yy4ckNg0jnAww3x9ixkHhBFHNJr7CZe91v v/Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=Rq0j3yqNSjN8ECHm4oUGhjglryzGAPRw7jN9R4FrNEM=; b=S1cpPxEKDd0mfX/FrFpTCcLciEsPq5ZFcfs6An0dqv97Ag4jQlFfaqpsnFhAEmGRQB 0+fhuvK+5vuAd/H3vuHpQPpUQnN6xVUSev30yVEHNTxhrqQxbWd9Orf3HJHCLVffA5Jx tLNe6LXVVyeIDlsFfPipqkq794UBAjbCsn/67OuTRz3NM89mV+Mibccd+IKNQ6IxIwVc sKSodnAXpNXxlfTbPZDyLF0ykbQA/fYcFxB/D/gizdWVeVX86U8M6DrtSrFVg6U+vw54 s0K1CdiqVXkn0dXBcRkzg/VjIFOTnGLFPeF/8K8sLSaHxjROfbRHiPsB3myS7TfMDFrn t42g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=FbY+VVRF; dkim=fail header.i=@chromium.org header.s=google header.b=foOANkmU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r9-v6si3926329pfg.247.2018.05.11.13.18.00; Fri, 11 May 2018 13:18:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=FbY+VVRF; dkim=fail header.i=@chromium.org header.s=google header.b=foOANkmU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751787AbeEKUQW (ORCPT + 99 others); Fri, 11 May 2018 16:16:22 -0400 Received: from mail-vk0-f67.google.com ([209.85.213.67]:41244 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750711AbeEKUQV (ORCPT ); Fri, 11 May 2018 16:16:21 -0400 Received: by mail-vk0-f67.google.com with SMTP id 131-v6so3990987vkf.8 for ; Fri, 11 May 2018 13:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Rq0j3yqNSjN8ECHm4oUGhjglryzGAPRw7jN9R4FrNEM=; b=FbY+VVRFrXB6PSJG/AuvUXj9oaVlqC+9MPKhRn7EFTnVrjBUJ79eZk2qsVJPYWsQBb +N64y7XvP9EHf4Af1P/UZ5I3YEb5tvip0XpvxY+8NoZGx86nD9lnr9mjIbmBnKE3nJkn kGhPS+qSNr/1f9HA4lCvzMgxAMuLnuvL5MqUQ7cbPBbyOwPRcSVcCN5kgTZ8RT9zFySv O3d6fPL3bvpZjWz1/8U6LPgV7voLxhkbu0JVTD5hU7ZvXkzXf+28KbHe9umWRHovvOXS HV+PNNSjSvui7UIHdncsv4OzRo52mzBRqvNxFJUNtofsuPurwyI+eH4pnkJP+NOITI1Z iQzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Rq0j3yqNSjN8ECHm4oUGhjglryzGAPRw7jN9R4FrNEM=; b=foOANkmUuAnBbn2muq42M/piTfzsnZ5PuC+m/QxQ6rNbePFxwW2TRPNp7YLdA3hbb/ fcR8kUnEwfUDP/CudLDdB4dUvxsGdRKuXXXUQ8LMj0lYcLexKrOJ0lr3rOahzAbLEB7c MNgo0pSnTnxDUiIQp5HXRhraVvTqlqp8JvOc0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Rq0j3yqNSjN8ECHm4oUGhjglryzGAPRw7jN9R4FrNEM=; b=F6Li6pI4ERrCfnLzfMON7MGZUgXn9GBUcctugWhIHj8I/+AVQJeVN7Zj/+QR/JUKIp WnJx5OZNEgmFdP9nJ2oe5nwhvgzNm2KjYIErrZS8rTV5ZMRfqBVZP5RHUoARzlHO/KC/ hRFIw1pE0DSI5zkH/+9RgQmE4CTEf8r7AaEhQ3sYlhIvZ4iIkRVJPR70kIpnPGkVgwkc VKu5vpaUHQMJHbfqTdzfJe0kJc6sgj7yykadlrA2R93ipBzKaH1C4Mxs3E6dQ21CYqTy e9Mw/3t8DUbc9qMkMFM2yKWvehqxNhcseg2gcLySo/y6saIT9O04wjXgJSznpSNeEfMX KKlQ== X-Gm-Message-State: ALKqPweGLK/2ULOx223tHj/FuICKVxke8kpocRrsm0aLw+1GGriXm/0g gMXQQN+Gw5fecFy4A1MNLVJY7oOMCpVH2ztzLbSbSA== X-Received: by 2002:a1f:d304:: with SMTP id k4-v6mr2418107vkg.101.1526069779779; Fri, 11 May 2018 13:16:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.48.82 with HTTP; Fri, 11 May 2018 13:16:19 -0700 (PDT) In-Reply-To: <20180509170159.29682-9-ilina@codeaurora.org> References: <20180509170159.29682-1-ilina@codeaurora.org> <20180509170159.29682-9-ilina@codeaurora.org> From: Doug Anderson Date: Fri, 11 May 2018 13:16:19 -0700 X-Google-Sender-Auth: CzZ5QuVXHyen0Da5cACUGWTwLL0 Message-ID: Subject: Re: [PATCH v8 08/10] drivers: qcom: rpmh: allow requests to be sent asynchronously To: Lina Iyer Cc: Andy Gross , David Brown , linux-arm-msm@vger.kernel.org, "open list:ARM/QUALCOMM SUPPORT" , Rajendra Nayak , Bjorn Andersson , LKML , Stephen Boyd , Evan Green , Matthias Kaehlcke , rplsssn@codeaurora.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, May 9, 2018 at 10:01 AM, Lina Iyer wrote: > /** > @@ -137,6 +140,8 @@ void rpmh_tx_done(const struct tcs_request *msg, int r) > dev_err(rpm_msg->dev, "RPMH TX fail in msg addr=%#x, err=%d\n", > rpm_msg->msg.cmds[0].addr, r); > > + kfree(rpm_msg->free); > + The way the code is written makes it seem like you could free memory _and_ have a completion but you can't. Specifically: * The only plausible thing that "rpm_msg->free" could point to is "rpm_msg". * The complete(compl) would then be accessing freed memory. I believe the kfree() should be at the end of the function. Personally I'd make it more obvious that this is just a boolean value and change to: if (rpm_msg->needs_free) kgree(rpm_msg) ...then the reader of the code doesn't need to go figure out what you're trying to free. -Doug