Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3591554ybc; Thu, 21 Nov 2019 10:33:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwTEylqY3vAXXGSrO+gW9S69GmhO3XnZ25Y8/R5m5yryT1BHezsY0ZU2Fs2JKWfMN1s1t7/ X-Received: by 2002:a17:906:12d3:: with SMTP id l19mr14911068ejb.165.1574361208386; Thu, 21 Nov 2019 10:33:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574361208; cv=none; d=google.com; s=arc-20160816; b=I3LRjn9231x6MwCihieb3Lj7QQPHHWkGSqI0rt+cKV8R9oWgozyzox4PO2098YZyT1 X+6+kfCbmgFaot9zn0wMjdYZvuM3Cf9ajW5o+KqGvMnBYopzBrohLcyYPeoh4kHm1VAg MmW1GVVJODQXVux2HK4Jvb3f1lQS3s44R9onYatC7JdQJ+bBQ+kBynXOApS72PN7vLQF /jVrGsMk6i7ACLn255h5pIa4PVv08yR2upatu5o2yAfhItXB+LbnbbyHeoPvKx3HVdpA uZtMsD1VvcBqmoIP4jwntg/HB0QSP0q+Iqb2hxKYwjapWt5txlVK+naLbZt5NXdNqohD 7OXA== 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 :in-reply-to:references:mime-version:dkim-signature; bh=zes9nx3wWOfwgkI+Dul1p5z28VLkMHp34WWYw/4B4xM=; b=OQLO98fgJDucCcoXmc2iXwXxJsE8O0gfSpF4IsTPbWB/eWV2B089OhmU28j2in8TAZ AFFsAU/S6xl2v8ADZPCxyER0rNQxA/imA0jo0nKnpoviASNbLTfXuAplmU9U24XqT3DP lVhmRhnIbfBqoFkznADkQYw2tndUBbBlF5jqJ2sFP9bkinCUKUYaPbfh/0NCxc8hV6JL QQh9DI+pxCE8MIK3sw72pK++cuhFA8gK+s322O+LrQyMdgiH8BEL7UCyZVxc2NXX3g/f e9JOQ8IZu77r9UeWSHHWwZqWgyWPIh5v/qhxniR6QJcbcH02JqlMx9hs4dU6sVPIrpF+ SgnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Wkp25PFc; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si2452963ejq.54.2019.11.21.10.33.03; Thu, 21 Nov 2019 10:33:28 -0800 (PST) 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=pass header.i=@gmail.com header.s=20161025 header.b=Wkp25PFc; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726922AbfKUSb3 (ORCPT + 99 others); Thu, 21 Nov 2019 13:31:29 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:45224 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbfKUSb3 (ORCPT ); Thu, 21 Nov 2019 13:31:29 -0500 Received: by mail-oi1-f195.google.com with SMTP id 14so4067976oir.12 for ; Thu, 21 Nov 2019 10:31:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zes9nx3wWOfwgkI+Dul1p5z28VLkMHp34WWYw/4B4xM=; b=Wkp25PFcZ403A1Ab9dtH00UDW+ztY9yfO5ob/GgE/2yV3cRKXm7YMtYFtLdE+Dsva3 9Rp7LdEU0QVZIsPXy980hXnC4LQ9KYwFcnhhwyD0vo4Ok6W3S6MZRT5jISG4FvLREXtz AWAp8TsSWkWK8zlCxWzKcEZ/j6zwmvwRFNOG78fD68Z8CxTbK06XUuEF+1q0XUT1Ovhs C0xgW4AGzSMcuLFkJ64mQbF2vtg/0a2TRJhlwNHdWkkfTCAr3cgi3cBxR9GKcC1Gkppu YTEvvuuBpO9jyZpYHtYh0xn7CGIvTzBvTNIjpSvir4A692IKFEazzfbK47bCNvU0KlKx qS1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zes9nx3wWOfwgkI+Dul1p5z28VLkMHp34WWYw/4B4xM=; b=ip9C865k/878yljdalDJ6T2kJo9FpADAkkeNt0cz98cQK3bWM4tyk3ZH5vViEPK8LG zJt2P5GUr9K1R0rmoUy9tSDzEJTvP6sNWtGVKJpZkQmpVZX/+en8vj2mrLfNV8TIOyGQ EwUoMmmdI8eg1iCgwKVA1YXWhhLWmbvfUuoa5Pp2zbX/s9aSZ26vueHFrDJtj7dfD8jm xeHGjtqcntBTI/NTgq3+deRNJVwj8armrZBk2hx9ZhpXzX5+4prhrUtrroGRYF/ZlUhf qoKY9KrYBl1vlj3RJXHNdVg8is6gV2DvTKcmTfDlsuhwVSbHDT0nI+pDGeGbg83WUqDC 06sw== X-Gm-Message-State: APjAAAUbeUpWr7iIXVqNOqOB8OLLNLLSGRQLtSChwl9xMBACqxaIAcym XE8EL3XpKPDCicW6bpocBSn26GMsLp1nq9jSIPw= X-Received: by 2002:aca:c50f:: with SMTP id v15mr9263185oif.5.1574361088233; Thu, 21 Nov 2019 10:31:28 -0800 (PST) MIME-Version: 1.0 References: <20191004190938.15353-1-navid.emamdoost@gmail.com> In-Reply-To: <20191004190938.15353-1-navid.emamdoost@gmail.com> From: Navid Emamdoost Date: Thu, 21 Nov 2019 12:31:17 -0600 Message-ID: Subject: Re: [PATCH] drm/imx: fix memory leak in imx_pd_bind To: Philipp Zabel , David Airlie , Daniel Vetter , Sascha Hauer , Shawn Guo , Fabio Estevam Cc: Navid Emamdoost , Pengutronix Kernel Team , NXP Linux Team , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, LKML 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 On Fri, Oct 4, 2019 at 2:09 PM Navid Emamdoost wrote: > > In imx_pd_bind, the duplicated memory for imxpd->edid via kmemdup should > be released in drm_of_find_panel_or_bridge or imx_pd_register fail. > > Fixes: ebc944613567 ("drm: convert drivers to use drm_of_find_panel_or_bridge") > Fixes: 19022aaae677 ("staging: drm/imx: Add parallel display support") > Signed-off-by: Navid Emamdoost > --- Would you please review this patch? Thanks, > drivers/gpu/drm/imx/parallel-display.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c > index e7ce17503ae1..9522d2cb0ad5 100644 > --- a/drivers/gpu/drm/imx/parallel-display.c > +++ b/drivers/gpu/drm/imx/parallel-display.c > @@ -227,14 +227,18 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data) > > /* port@1 is the output port */ > ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel, &imxpd->bridge); > - if (ret && ret != -ENODEV) > + if (ret && ret != -ENODEV) { > + kfree(imxpd->edid); > return ret; > + } > > imxpd->dev = dev; > > ret = imx_pd_register(drm, imxpd); > - if (ret) > + if (ret) { > + kfree(imxpd->edid); > return ret; > + } > > dev_set_drvdata(dev, imxpd); > > -- > 2.17.1 > -- Navid.