Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2209779ybl; Sun, 18 Aug 2019 21:08:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpNmPBz8Gq2bJ+/yXNeBU44uL+gj5Qi1a5wSBU9UrdF58AE2EA9CApakY1gorNdc0OMe0P X-Received: by 2002:a63:1310:: with SMTP id i16mr17890291pgl.187.1566187685009; Sun, 18 Aug 2019 21:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566187685; cv=none; d=google.com; s=arc-20160816; b=gWDbeEFK/F1Os28Td22ANd99lRXn1J1oNburBcqLUAVtXG67V1y7t0bgsjwZXF3c0L 7m02JG7CBL0sJre9k3qrdErsRXVXXvE/xCMomJR8APINmITJ3BBeV4Mp7MHvTDhe+777 DXk3QE9sBzzphd96zRczLYaYD9eiYuJFGQG/jh0zsZZhnE5+3hF/JxLSFbYoRTEcPivk 8GoNswRSUD4rEjpHwzTkhlSH91Ai1zNq1/Hp0t/pnBGU0Xd/7HsxiFUWITQ7obnesVv6 pb++z8DVOAjbxQW6v/D4c87d9AjkJT1WYZQf3lZ8gopV/qBhc/IiGl0Q2L+DLeLRfmdN JAEQ== 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=PPbQdYyCeikWXeCzzJyCalBEj0GFXKEGI6wDSmoOtt0=; b=q9z/lzUyViX+RJ3Z/WOCnAbrz5M1iopEZ7/+qDNrydTb6zw6DwaDKGyPeoPLlDZP6e /1DjzBll5k9T6bXHrKRrYrkLmGgYGmuHn7Y7yVG2K7pzDClH223sy/dHXixVF66+WF7+ hwKVltbxZB6V2ZJ2Nzh6EtgfwDHHR5ndvoyu7+qV86cbzPdGSDBhGEsSxb5NCgF+yq8I Uqalh35ibHZQusnYDnHbACtt8zljU/i5c5BYYIu4en5sehL/fKARJE+Tk6n8QKU8Wznz hATk8BHWm9bRMB+A36jUibwQo85PAGSkk0YzvyASwkp42EJLrtKIFv3dvCXfGC7NWsHH CJwg== 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 3si9067152plu.154.2019.08.18.21.07.48; Sun, 18 Aug 2019 21:08:04 -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 S1725958AbfHSEGi (ORCPT + 99 others); Mon, 19 Aug 2019 00:06:38 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:41630 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbfHSEGi (ORCPT ); Mon, 19 Aug 2019 00:06:38 -0400 Received: by mail-yb1-f196.google.com with SMTP id n7so148923ybd.8 for ; Sun, 18 Aug 2019 21:06:37 -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=PPbQdYyCeikWXeCzzJyCalBEj0GFXKEGI6wDSmoOtt0=; b=TuMbiSJ+LiR196k85BhnGwrkna3ZbNm3rLphguZJlMWsqOLNO9QHlrXiwwjZPmHW6P vrfSxzL04JlSPiC/yOL4/TgNJ7kPMygpJf7oYI15WRFYWVUH28fftR0d0ci1jtTJRoZ3 bVtx+/Z5dPvpsNVDsFnqJPr4ZUhoGnEcfFttPaMpxANHqaK60XGPbs3V0gPjltJD0Ljm gt7K27sTdgk2r6UFG0IaDT24EMZnINBDh7a9qazmV9ZL2nzW1AFWlYHtdsbcl8A98bjR 1qPr2aKsoyZAHeXRmvoBlWuFSCdoJ3OuXt6Lm1GUZQ5xDwFswnUZwGEFHVeG260lDRXe 7Dpg== X-Gm-Message-State: APjAAAXYKwWidVGinznhVDkGJyNyKnbNTIBaecVQLispuCoZssz4wqvx uv4mPkywCZqGhGA4+Zx7xeo= X-Received: by 2002:a25:c603:: with SMTP id k3mr15008655ybf.409.1566187596936; Sun, 18 Aug 2019 21:06:36 -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 l82sm2939148ywb.64.2019.08.18.21.06.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Aug 2019 21:06:36 -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/resource leaks Date: Sun, 18 Aug 2019 23:06:17 -0500 Message-Id: <1566187591-8263-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 psb_driver_load(), if gma_backlight_init() fails, no cleanup is executed, leading to memory/resource leaks. To fix this issue, go to the 'out_err' label to perform the cleanup work. Signed-off-by: Wenwen Wang --- drivers/gpu/drm/gma500/psb_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 7005f8f..8d264ad 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -383,7 +383,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags) } if (ret) - return ret; + goto out_err; psb_intel_opregion_enable_asle(dev); #if 0 /* Enable runtime pm at last */ -- 2.7.4