Received: by 10.223.185.116 with SMTP id b49csp1115404wrg; Sat, 3 Mar 2018 16:02:14 -0800 (PST) X-Google-Smtp-Source: AG47ELvvS8kJ+NagjzyOOUrNKfUc4WLWZnHvZCmBPbOPMmo9xs4Wme9O6rgHxsHk3iu2zWGpt9dF X-Received: by 10.99.166.10 with SMTP id t10mr8364081pge.198.1520121734605; Sat, 03 Mar 2018 16:02:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520121734; cv=none; d=google.com; s=arc-20160816; b=uGi+GDKjWa9wI+gOdALqMDmM46nQwoEjVGo/ax8HU7JkZ31jLP2KEdQALagJUzqfPf pLOXfZ07vfTXXKztNFhOQLHotIYNviWTnpcz2KunjF1GqQeVP+5xa+jlKeTihOCjHBpI JjzcGefpSZfS6kbGQBOV7H4b2+sXVchagf1kGlJSyzWAMopl8zuCxjIKA0dHnGNOBK5Q PW3tLKXODmSeXm/w/RSkP0woCQztzKBOtJ1TAZ9F3NxZFXN3BiCj+pS13bTgd2yffKAN CPd7zKHCTPyFu0SY6wQWBOiGGDWiBqHFbv8RVPcu9IhPqzSihmNnwQnrC0mpccXFJ0NF Q7zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=TgklLVZTRDjRw0Z0jgB5ZQX57ArRRocw6OI0h9rEQUU=; b=n24yWivF4fwFmWE9aiQwpVywvgh2UhmrBqkyP5DK8EoYUdYB/p2nK7Ren1YI8nVVcS 6oY05lwZZD7f6so6E/FmyhNzKpTgFR1/hRRLkjV2V1ewmXD/Gl9PQhBQ/mI1L127ONnE NNHVxEmF3Uy64XWdTevlxAKO9tDG1i8Of9TYQd207pL/0YXf8ZYnO9Ho4RK7JQ1q9g8P GEfZjfRYRKWv71yQJoD3NSpjPOl4/91dYQTuCAUIqHVFr2npBgVw6A2pOoNPJ76j2uN/ 2HCDbrMeDOxdSMojLIxUOJF+dMVPKkHPJXLQZpvQ3S+OMGQ4p7z9niIjHfjiHfjcIRgq GWZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=cBxFq6GS; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3-v6si6878543plp.38.2018.03.03.16.02.00; Sat, 03 Mar 2018 16:02:14 -0800 (PST) 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=@microsoft.com header.s=selector1 header.b=cBxFq6GS; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933828AbeCDAAO (ORCPT + 99 others); Sat, 3 Mar 2018 19:00:14 -0500 Received: from mail-co1nam03on0109.outbound.protection.outlook.com ([104.47.40.109]:6764 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933786AbeCCWcH (ORCPT ); Sat, 3 Mar 2018 17:32:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TgklLVZTRDjRw0Z0jgB5ZQX57ArRRocw6OI0h9rEQUU=; b=cBxFq6GSDoxpcXxdVNgjoBrMgoiE2qXRyDknPmJlDykCEkRML3mV59bf2ms515T+2Y+Un075XZWlE2vfSxEF5+j9xj+lbYcFuFA9BCeP19bRffZxZ+CBDNT0eGD9CzGxNimVnw9eYjOBBCD/qk79HsB1055bbY2R9vnsHjr+/bI= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB1083.namprd21.prod.outlook.com (52.132.149.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.1; Sat, 3 Mar 2018 22:32:02 +0000 Received: from MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0]) by MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0%3]) with mapi id 15.20.0567.006; Sat, 3 Mar 2018 22:32:02 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Arvind Yadav , "tomi.valkeinen@ti.com" , Bartlomiej Zolnierkiewicz , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 042/219] omapfb: dss: Handle return errors in dss_init_ports() Thread-Topic: [PATCH AUTOSEL for 4.9 042/219] omapfb: dss: Handle return errors in dss_init_ports() Thread-Index: AQHTsz7u4e9uoFn9XUGA9fNkv70RjA== Date: Sat, 3 Mar 2018 22:28:20 +0000 Message-ID: <20180303222716.26640-42-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MW2PR2101MB1083;7:hrcxJanjlapy44d+qIZ1YWOp+bMPhu7vzs6sSzp+upHpSQ5u4t379yqUsJiR47Y1m7hCQfAOo1kFDyiFe0ZK3kgrAgNREdVQzBM5uDol6Ao0UPodAgzUNH6AaMUCisUkfFVXP37YTK4pRhnQ0e0HGYrNu4c1Az2cgstvb4+WsHTn7f7d9DCIkAEUjb1f9G2k0wmD8aZimT97QRtAeauPRiIHsa4Nk42B50L3zw0G7tc8B8Ld5YWAZEchxWmMEBJc x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c9278bb4-69ad-479d-4c1b-08d58156962f x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020);SRVR:MW2PR2101MB1083; x-ms-traffictypediagnostic: MW2PR2101MB1083: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(31051911155226)(89211679590171)(85827821059158)(7411616537696); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB1083;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB1083; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(39860400002)(39380400002)(396003)(346002)(366004)(189003)(199004)(106356001)(53936002)(316002)(39060400002)(305945005)(7736002)(3280700002)(107886003)(2906002)(6512007)(6436002)(97736004)(3660700001)(6486002)(99286004)(81166006)(8936002)(81156014)(76176011)(8676002)(25786009)(2950100002)(6506007)(4326008)(110136005)(5250100002)(54906003)(36756003)(105586002)(6116002)(6666003)(22452003)(86612001)(10090500001)(186003)(68736007)(26005)(2900100001)(86362001)(66066001)(102836004)(3846002)(14454004)(478600001)(72206003)(10290500003)(5660300001)(1076002)(2501003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB1083;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: fkGthzvb5l9WX7MsrOoavuBFGIC2TitSQ6M89SAG3oVWjxuJ5D7sBn+4+3ZWXVRFLyfZMVL5Tw3pBF+uIiE4BEfo9F2Nt9JPlxfY/0Od2o8Ln3nv9+PNKI9IskAFAc2MiAELBy5UMw2Dl+LRL2dDLW17wonO3fWwKZ3jW48EJzc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9278bb4-69ad-479d-4c1b-08d58156962f X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:28:20.1662 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1083 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arvind Yadav [ Upstream commit 0348aaa34412e24ebe622a2b1b013e68d6ae5412 ] dss_init_ports() is not handling return errors from dpi_init_port() and sdi_init_port(). It is also always returning 0 currently which results in part of error handling code in dss_bind() being unused. Fix dss_init_ports() to handle return errors from dpi_init_port() and sdi_init_port(). Signed-off-by: Arvind Yadav Cc: tomi.valkeinen@ti.com [b.zolnierkie: fail early on errors, minor fixups] Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Sasha Levin --- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbd= ev/omap2/omapfb/dss/dss.c index 47d7f69ad9ad..48c6500c24e1 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -941,11 +941,13 @@ static int dss_init_features(struct platform_device *= pdev) return 0; } =20 +static void dss_uninit_ports(struct platform_device *pdev); + static int dss_init_ports(struct platform_device *pdev) { struct device_node *parent =3D pdev->dev.of_node; struct device_node *port; - int r; + int r, ret =3D 0; =20 if (parent =3D=3D NULL) return 0; @@ -972,17 +974,21 @@ static int dss_init_ports(struct platform_device *pde= v) =20 switch (port_type) { case OMAP_DISPLAY_TYPE_DPI: - dpi_init_port(pdev, port); + ret =3D dpi_init_port(pdev, port); break; case OMAP_DISPLAY_TYPE_SDI: - sdi_init_port(pdev, port); + ret =3D sdi_init_port(pdev, port); break; default: break; } - } while ((port =3D omapdss_of_get_next_port(parent, port)) !=3D NULL); + } while (!ret && + (port =3D omapdss_of_get_next_port(parent, port)) !=3D NULL); =20 - return 0; + if (ret) + dss_uninit_ports(pdev); + + return ret; } =20 static void dss_uninit_ports(struct platform_device *pdev) --=20 2.14.1