From patchwork Thu Nov 22 06:42:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13063 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id EDEE323FC6 for ; Thu, 22 Nov 2012 06:48:39 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id A4C82A188F2 for ; Thu, 22 Nov 2012 06:48:39 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so3000258iag.11 for ; Wed, 21 Nov 2012 22:48:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=dnDD7D5JlkQfWhcgDbbmE+LDhcgu9MwTWQ1Kkct9Rsc=; b=Fzm/rKtOUvj4HBomgwkwL+wiLvbYpl3Z7j3ygwus6zqAc24LxUvPgeUl00Tl0AGn4G YrzfdDrUQvUHfuATmuX2EqdevpfgMAaUY9XCmWX5vH9ElOdXrlGBVY1SCxdfzJEQN7F9 rnfFjFN3LFEBqWNMm7rQiQLV8jM5VjgeUeM9csXzo6ZQxVTGFImKqSk1vP1EyHsdsQYQ RRcEYA5O/j7TTQ8Le/L0MPAxMTFxX0qofQkje6xZP/SVR6rIMdFrV5tcyWU/KXX7/IbM tLT4yUoxqMm8rySrMPIJXeuloLOY5fGa+7vTiYeLkqiNQYqf3+KMh44S/PBW424P6p/T Mv6A== Received: by 10.50.173.34 with SMTP id bh2mr2090795igc.70.1353566919185; Wed, 21 Nov 2012 22:48:39 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp164700igt; Wed, 21 Nov 2012 22:48:38 -0800 (PST) Received: by 10.68.239.163 with SMTP id vt3mr1814924pbc.153.1353566918528; Wed, 21 Nov 2012 22:48:38 -0800 (PST) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id e6si3342445paw.56.2012.11.21.22.48.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 22:48:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.220.46; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-pa0-f46.google.com with SMTP id bh2so2665713pad.19 for ; Wed, 21 Nov 2012 22:48:38 -0800 (PST) Received: by 10.68.193.167 with SMTP id hp7mr1896458pbc.124.1353566918296; Wed, 21 Nov 2012 22:48:38 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id vn2sm1558688pbc.31.2012.11.21.22.48.31 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 22:48:36 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: FlorianSchandinat@gmx.de, linux@prisktech.co.nz, patches@linaro.org Subject: [PATCH 2/4] video: vt8500: Fix invalid free of devm_ allocated data Date: Thu, 22 Nov 2012 12:12:09 +0530 Message-Id: <1353566531-31251-3-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353566531-31251-1-git-send-email-tushar.behera@linaro.org> References: <1353566531-31251-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQkslu5UpD5BXSaE0ixNq/ltDZe2JTJ/L2kXS8QPKPM38q0C16/m08Srcl58BsOTqiq1Il4t While at it, also fix the related return statements. Signed-off-by: Tushar Behera --- drivers/video/vt8500lcdfb.c | 15 +++------------ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c index 5777adc..2438368 100644 --- a/drivers/video/vt8500lcdfb.c +++ b/drivers/video/vt8500lcdfb.c @@ -294,8 +294,7 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev) + sizeof(u32) * 16, GFP_KERNEL); if (!fbi) { dev_err(&pdev->dev, "Failed to initialize framebuffer device\n"); - ret = -ENOMEM; - goto failed; + return -ENOMEM; } strcpy(fbi->fb.fix.id, "VT8500 LCD"); @@ -328,15 +327,13 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res == NULL) { dev_err(&pdev->dev, "no I/O memory resource defined\n"); - ret = -ENODEV; - goto failed_fbi; + return -ENODEV; } res = request_mem_region(res->start, resource_size(res), "vt8500lcd"); if (res == NULL) { dev_err(&pdev->dev, "failed to request I/O memory\n"); - ret = -EBUSY; - goto failed_fbi; + return -EBUSY; } fbi->regbase = ioremap(res->start, resource_size(res)); @@ -466,10 +463,6 @@ failed_free_io: iounmap(fbi->regbase); failed_free_res: release_mem_region(res->start, resource_size(res)); -failed_fbi: - platform_set_drvdata(pdev, NULL); - kfree(fbi); -failed: return ret; } @@ -501,8 +494,6 @@ static int __devexit vt8500lcd_remove(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); release_mem_region(res->start, resource_size(res)); - kfree(fbi); - return 0; }