From patchwork Wed Sep 14 12:17:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9331313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9A826089F for ; Wed, 14 Sep 2016 12:18:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A909629D3B for ; Wed, 14 Sep 2016 12:18:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DF4229D4B; Wed, 14 Sep 2016 12:18:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7910129D3B for ; Wed, 14 Sep 2016 12:18:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761361AbcINMSj (ORCPT ); Wed, 14 Sep 2016 08:18:39 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34035 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761311AbcINMSi (ORCPT ); Wed, 14 Sep 2016 08:18:38 -0400 Received: by mail-pf0-f196.google.com with SMTP id g202so728619pfb.1; Wed, 14 Sep 2016 05:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=P/VUkI6IXtXozE5vOJErrPpRc3NCqgIUuPkZyF8ofRM=; b=QDx0U9+Rahb/YbdzLsf6SwzjQf+2Y25Jv5Ay3hhyzL4KGJMCa8+RtkX1xzQ8A+2TJs D7LCpIxLQNphPYf1kmDVoLelcDUuh3KpMPet0c3imhM+HbBWcaiGZNsrZd/1Gmkatj+O IcJpSEXIMwyWcJDeo/WWBBTCDUy6UDbuY6cXWjnGl/GLe+1p+7JiRqg2l9I7WYtz7V49 2IzqeUYokMNXjdL+Nir3geQ9S0PHJYK3d4DvV1S7UudtcKEQgv1HPbVmL1ZDOZTTxBST 00syxUng0GVI/5NIVmztXnfTYqFNZFEIlEJjSGcIyTt1QQK6srTdg21o1T80FzP5mBqN YfKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P/VUkI6IXtXozE5vOJErrPpRc3NCqgIUuPkZyF8ofRM=; b=i46kJvdkESGsrplp0nnJrQUkaX/vyVz1ElDh7y9OmFvrV+xfbOoyqm6jDiMDz+CUuM qpaIAJoq3hfvz/6fjWw2CQQnTuCJkxVZ/jwTLT0dDjrW/kLR8fPT4u5gcBN/HiBjCyWJ QqMgI32MKA2radeEwjCj9u+iZAUq8bRXTJ5aparZioPowdYFITQwPdMByFaPm/JnouaL l1CqrPb3T4S0ZuvwwBdcdETWTT8kgILm6sWkmhV/kozkMnaNXhBQnisjTz8MJsw0Giud ECkR6B9HXfc7QWM7ob5iWKKvhABKfeaJqntUveGE9AQ7NnS/A79fGAolmlSl5VDOy3uB JTXQ== X-Gm-Message-State: AE9vXwO4R7E3GY4HanQNcpIMMCrbf0S4lqzPgP2jMXR5uiNGVrv7FIGMqWfGkgGtrPntwQ== X-Received: by 10.98.141.219 with SMTP id p88mr3913404pfk.153.1473855517800; Wed, 14 Sep 2016 05:18:37 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.symbol.com ([140.101.159.242]) by smtp.googlemail.com with ESMTPSA id f16sm33875892pfd.84.2016.09.14.05.18.34 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Sep 2016 05:18:36 -0700 (PDT) From: Arvind Yadav To: timur@tabi.org, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] video: fbdev: fsl-diu-fb: Return value is not handled correctly Date: Wed, 14 Sep 2016 17:47:50 +0530 Message-Id: <1473855470-16632-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP -Free memory mapping after mapping done. -uninstall framebuffer after framebuffer intallation done. Signed-off-by: Arvind Yadav --- drivers/video/fbdev/fsl-diu-fb.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c index fe00a07..12449b4 100644 --- a/drivers/video/fbdev/fsl-diu-fb.c +++ b/drivers/video/fbdev/fsl-diu-fb.c @@ -1715,8 +1715,7 @@ static int fsl_diu_probe(struct platform_device *pdev) */ if ((unsigned long)data & 31) { dev_err(&pdev->dev, "misaligned allocation"); - ret = -ENOMEM; - goto error; + return -ENOMEM; } spin_lock_init(&data->reg_lock); @@ -1752,8 +1751,7 @@ static int fsl_diu_probe(struct platform_device *pdev) data->diu_reg = of_iomap(np, 0); if (!data->diu_reg) { dev_err(&pdev->dev, "cannot map DIU registers\n"); - ret = -EFAULT; - goto error; + return -EFAULT; } /* Get the IRQ of the DIU */ @@ -1762,7 +1760,7 @@ static int fsl_diu_probe(struct platform_device *pdev) if (!data->irq) { dev_err(&pdev->dev, "could not get DIU IRQ\n"); ret = -EINVAL; - goto error; + goto err_unmap; } data->monitor_port = monitor_port; @@ -1797,7 +1795,7 @@ static int fsl_diu_probe(struct platform_device *pdev) data->diu_reg); if (ret) { dev_err(&pdev->dev, "could not claim irq\n"); - goto error; + goto err_unmap; } for (i = 0; i < NUM_AOIS; i++) { @@ -1826,7 +1824,7 @@ static int fsl_diu_probe(struct platform_device *pdev) error: for (i = 0; i < NUM_AOIS; i++) uninstall_fb(&data->fsl_diu_info[i]); - +err_unmap: iounmap(data->diu_reg); return ret;