Received: by 10.213.65.68 with SMTP id h4csp1773871imn; Mon, 19 Mar 2018 12:54:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELsDQQWRWADiZG2ctFhWVsg4Oeo1ffcaMtHHG9LbiF1Sm2hP4zaZK+VqvzAidOGPf6+GEB8Q X-Received: by 10.99.174.67 with SMTP id e3mr9634275pgp.139.1521489274995; Mon, 19 Mar 2018 12:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521489274; cv=none; d=google.com; s=arc-20160816; b=I8dRl3Ve0UGW2925TVlVw+8zv233YodyCGwcaro8bGtZVh/1wnj2oHqYApjbNydo+X WUNZJEsFSgy/WizDLd2F1or6NxUh8hUlc/N3g2nndsL8Fcx6Fi2HG6jxXNzQXbl0Xj+W 9YrRISvKsAZ24He01qH2yM6qqvL+YAeZmzU2ZE95BSarldSNWGKopJCPsvfQzjUW7YOv /DOOqQMeCoYa0s4KiFNCpR+jS/cXF8n4AMJnOiHLhaPG0015MhQux2ehyygB6gMYlRXa yREL24ogg39y+ABa4HD8wd388bWgBMaZfoZ4f5Cw4KqU3A4tmEccl7AY8zFfVaiEZ4AD dOgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=CvttG7Z8QqJ/CHEiwfpa5cK3vZld6mTXtIocDzQZXQA=; b=yzb9SIcB7A9qTD6tczKr7yOijDSDfoCLVn/a/+WWtMQS75ig4GIyoZ5Ys0bhU+mKjH nDHFM9gEpUV3UKzb80RRMY3a2Zi02gpgsKNpvEKmhD0RlqBtNsXZaY4pqribCBW8Jpnz q0jkbjnp1+hqR8a6Q/AoirLru6kdnsiC0O+4AnoO+idLkkLTk3sAwtpdPwJTLrqNmVEF OAxlnUrxnBpytxf/i9jpBKRi90SDUWCd48ywwuosHOboVwWH7v3yuGz/2Ifb5z+/WxnU aKA7B5BEs53Vxg9CK+TnZkmg8p+ayFYWqDtG/ZoOkQaDcVEmFvC+ZkrtrxxiHukxIv10 JuYA== 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 u86si468437pfa.69.2018.03.19.12.54.20; Mon, 19 Mar 2018 12:54:34 -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 S970940AbeCSTw1 (ORCPT + 99 others); Mon, 19 Mar 2018 15:52:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47298 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969430AbeCSSTg (ORCPT ); Mon, 19 Mar 2018 14:19:36 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9201F1157; Mon, 19 Mar 2018 18:19:35 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arvind Yadav , tomi.valkeinen@ti.com, Bartlomiej Zolnierkiewicz , Sasha Levin Subject: [PATCH 4.9 040/241] omapfb: dss: Handle return errors in dss_init_ports() Date: Mon, 19 Mar 2018 19:05:05 +0100 Message-Id: <20180319180752.861721795@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --- 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 plat return 0; } +static void dss_uninit_ports(struct platform_device *pdev); + static int dss_init_ports(struct platform_device *pdev) { struct device_node *parent = pdev->dev.of_node; struct device_node *port; - int r; + int r, ret = 0; if (parent == NULL) return 0; @@ -972,17 +974,21 @@ static int dss_init_ports(struct platfor switch (port_type) { case OMAP_DISPLAY_TYPE_DPI: - dpi_init_port(pdev, port); + ret = dpi_init_port(pdev, port); break; case OMAP_DISPLAY_TYPE_SDI: - sdi_init_port(pdev, port); + ret = sdi_init_port(pdev, port); break; default: break; } - } while ((port = omapdss_of_get_next_port(parent, port)) != NULL); + } while (!ret && + (port = omapdss_of_get_next_port(parent, port)) != NULL); - return 0; + if (ret) + dss_uninit_ports(pdev); + + return ret; } static void dss_uninit_ports(struct platform_device *pdev)