From patchwork Fri May 19 08:46:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 100181 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp209642qge; Fri, 19 May 2017 01:47:01 -0700 (PDT) X-Received: by 10.98.0.7 with SMTP id 7mr9263867pfa.127.1495183620917; Fri, 19 May 2017 01:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495183620; cv=none; d=google.com; s=arc-20160816; b=dXRlMCUyCBsLcsqiMM5I3jUovUEC7Rs4g1Wxv8Ykf//DhOvNelFKFNxGP9lMEjvPGc uY+TcDHdL7Cpf+N0FnfAC982xGojDrOcep3+DiTsVX67/0kBMk0JIKnK12TS3lYo4U0H H6+ha7yDE9AvBguiV1F4EV6j/ucLj1xagVKzQzMzAh+gY9RgAQ4qGmhN6VW6FHcx0dMD 2K/MmgkmcOG50ZJ9DaoU3lSwnKdgGIPAWECILjMAgmedM3ufcDELopNTVi+RK87WMEtj SemUUOlFtF0cUhojChktoXdM5NPelYit+YSfgAjk5zFfbKA6NyClIPjLjRnin91PyPqy zw5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=7IIy0A7p3vhVagFvnuCtVbfMbczQ15Pjn+/AsmYLbfU=; b=sjKLe9rpAQYyw3Fe4LOhvQSfx05DHliLrrPbkqRUGQOeM/EV2mgw1gdq42TTUPsO2i UP4/A3MeCbb64x4qiI5DAA13wF7yI5vWlHj6tXrYXwgDbrKO0Z8QGFfEXdLTMrX1CfTs 0MNcyGV/j8NymPEvfI7hWEQi+4UOBG+ysUMt0MjlBa7u+zHSDo15a01+X13jXXLThxVY FKarXMXvjHfTyo4tfLabADEC5fa5zoL6+ywMSHIwTbkT3fhgbl33dNayYe8N6wJ8o3BQ eQ38O03K3ZRgWNgfu5ffhqZl467uOf6cnM0xOZuOcnKF0n+GcRNfsoYhPAsO/WhIND8T 0ytg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si6577709ple.2.2017.05.19.01.47.00; Fri, 19 May 2017 01:47:00 -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; dkim=pass header.i=@ti.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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751948AbdESIqk (ORCPT + 25 others); Fri, 19 May 2017 04:46:40 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:11611 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbdESIqi (ORCPT ); Fri, 19 May 2017 04:46:38 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v4J8kbfC022577 for ; Fri, 19 May 2017 03:46:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1495183597; bh=owJyL/k1czh7I+LuU9BJkwuGh2zPYqMTAZe4aMkY7PM=; h=From:To:CC:Subject:Date; b=j5n4BJXqlxdPcnSPEqyldsMhmeB2tw5S8uQqultMt1B/UwkqETvT8skhYCUiGlG7b O1aXR66rBgP9SgOd7vxscct+QsU4z5AfARB7Eej2ic1qeKHsavxngkW0t5m/Jz3xIO nbIdXfVG29gQO30nNAOUU2pppiSldcU7SltBKiTw= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4J8kbAu011989 for ; Fri, 19 May 2017 03:46:37 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Fri, 19 May 2017 03:46:36 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4J8kZLf009680; Fri, 19 May 2017 03:46:36 -0500 From: Kishon Vijay Abraham I To: CC: , Subject: [PATCH] bus: omap-ocp2scp: Fix error handling in omap_ocp2scp_probe Date: Fri, 19 May 2017 14:16:31 +0530 Message-ID: <20170519084631.361-1-kishon@ti.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The error handling code in omap_ocp2scp_probe fails to invoke pm_runtime_disable and fails to initialize return value in certain cases. Fix it here. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sekhar Nori --- drivers/bus/omap-ocp2scp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c index bf500e0e7362..77791f3dcfc6 100644 --- a/drivers/bus/omap-ocp2scp.c +++ b/drivers/bus/omap-ocp2scp.c @@ -70,8 +70,10 @@ static int omap_ocp2scp_probe(struct platform_device *pdev) if (!of_device_is_compatible(np, "ti,am437x-ocp2scp")) { res = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(regs)) - goto err0; + if (IS_ERR(regs)) { + ret = PTR_ERR(regs); + goto err1; + } pm_runtime_get_sync(&pdev->dev); reg = readl_relaxed(regs + OCP2SCP_TIMING); @@ -83,6 +85,9 @@ static int omap_ocp2scp_probe(struct platform_device *pdev) return 0; +err1: + pm_runtime_disable(&pdev->dev); + err0: device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);