Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2171964ybl; Sun, 18 Aug 2019 20:14:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOK4qyz8a6d9vcm6xjbp95sQAnJ1ppKJhdST6LIsf+kgobF2+xMcldzJCpjAEfVVE8C1cH X-Received: by 2002:a63:553:: with SMTP id 80mr18577827pgf.280.1566184479820; Sun, 18 Aug 2019 20:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566184479; cv=none; d=google.com; s=arc-20160816; b=06tW1nAZUlG3jMPUhzlNxdxZAW+3oW3JuP+cEzd4PTW/0LLsgci37xx05uKcHLGKfP kAeUvgVkRA2lHFHkjTH3U+Ym+oigOJVgvxGN1vTiVE+6GpqLwICNmagjJ9jTF15uXl/a ANVIh/PXDjlsoGxU8LIlsFP8Du7tbHK78RR6XUOVQNS8PMbOnNmiNB5Zsd96nWHaLqmu CqeeEvwkR+5N1V1/wlR+tmdqe/yzq+CrULZB4+3c4U0SqQXua+pUkc2hRN+1+/kxNL6x DG2oOcOI6zk0Fh3MxmpjIfUla5RErqRdTNxpFKk7HGztVwDFRaf7IHbhQw3sBNlJ4RU7 SkNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=A70pDx8ZVFbh5we0DnKpwB7v/M6I0DIAyvofyE5IBX4=; b=wXXXu5qQsZmfdzozsUYiSd9OLIPARR6B5keDEJfxrhJaB0TUSWBS1FapYVpEeyK745 qgpNFQ+KregE3/S2y0a81qovBdhU2qBgnVkteTiXOLp7YtWS2+hU02exxcD3S1rEW3qv IDmw4sO+AGW6XzdcXN3wtkaky0vVvcwzrhp9Y1mxTsXofaNtfylSMa/JZeoZQuajTg1y XMs1i0KapzAkaLXTecE3wiyTFkdhYzXfKZ+215w0+hk++dNA9kAYArySFnEQ78GymQj1 zz42ZbNAkqdW1IfyJpscAs/jZQ4m7LdU1yiWRdwHqvngm9+Rw+fjGlVOBr2M2Z0cZ0mN 5KwA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si7784137pjo.83.2019.08.18.20.14.25; Sun, 18 Aug 2019 20:14:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726538AbfHSDN3 (ORCPT + 99 others); Sun, 18 Aug 2019 23:13:29 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:37661 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbfHSDN2 (ORCPT ); Sun, 18 Aug 2019 23:13:28 -0400 Received: by mail-yb1-f196.google.com with SMTP id t5so126140ybt.4 for ; Sun, 18 Aug 2019 20:13:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=A70pDx8ZVFbh5we0DnKpwB7v/M6I0DIAyvofyE5IBX4=; b=dxKAzLIt9RSR9Hy149eNPPhnpUHOnUSMsGYL1klam+fvxl0kjLTCSqpFhZtw8SSfsi K3MVT7Jb6KCgSGULOhUq+vRIpZom2UYDKtwYhPocW2xSmlk9zKbqvqAB3YX1GlABy2S6 g+DUaDrbq9VdP6VPQXVRVfZMh1ROPPJtY8RV5pmkgR9Z/Vl4tYZiVmSmu/uVHJKwdlYV AjZe20U/nOb158wLluHi4ADbOLJpTB7WIlhfKQfJ5V/H38mckiK77y4X/pwGNXOyCYm7 Remxl9LYYaMtx0zdyYjzLOB/keDAi7zoRIJHBHEtPVegiYKj093LmZVNMSPt9PWS9/48 ptOw== X-Gm-Message-State: APjAAAVugjNTHsYARRm+SflFxTPPFcKd5VIEfp6KfNwuw4m3eD4DUp3m dJJNzP4X83Ip7Jv9GWjRV/w= X-Received: by 2002:a25:cc8f:: with SMTP id l137mr14843735ybf.482.1566184407307; Sun, 18 Aug 2019 20:13:27 -0700 (PDT) Received: from localhost.localdomain (24-158-240-219.dhcp.smyr.ga.charter.com. [24.158.240.219]) by smtp.gmail.com with ESMTPSA id q65sm2860184ywc.11.2019.08.18.20.13.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Aug 2019 20:13:26 -0700 (PDT) From: Wenwen Wang To: Wenwen Wang Cc: Patrik Jakobsson , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org (open list) Subject: [PATCH] drm/gma500: fix memory leaks Date: Sun, 18 Aug 2019 22:12:57 -0500 Message-Id: <1566184395-7615-1-git-send-email-wenwen@cs.uga.edu> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In mdfld_dsi_output_init(), if mdfld_dsi_pkg_sender_init() fails, the execution is directed to the 'dsi_init_err0' label. However, some previously allocated buffers and resources are not deallocated, leading to memory/resource leaks. To fix this issue, revise the 'dsi_init_err0' label. Signed-off-by: Wenwen Wang --- drivers/gpu/drm/gma500/mdfld_dsi_output.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c index 03023fa..ab9e935 100644 --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c @@ -592,11 +592,10 @@ void mdfld_dsi_output_init(struct drm_device *dev, dsi_init_err1: /*destroy sender*/ mdfld_dsi_pkg_sender_destroy(dsi_connector->pkg_sender); - +dsi_init_err0: drm_connector_cleanup(connector); kfree(dsi_config->fixed_mode); kfree(dsi_config); -dsi_init_err0: kfree(dsi_connector); } -- 2.7.4