From patchwork Wed May 2 09:11:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 134822 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp448274lji; Wed, 2 May 2018 02:12:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqEgNixklxOsjdNP1BeOvD/6fTfkvA2EaXDj8h2+bBAsTgio2Hbs/Q1DdQ6mUoIhps9d2Ed X-Received: by 2002:a63:6742:: with SMTP id b63-v6mr1089392pgc.54.1525252333594; Wed, 02 May 2018 02:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525252333; cv=none; d=google.com; s=arc-20160816; b=fL5n/XV5f9L8rP4TdQ+TDesUTuKNfK8+lvUYo55xxh3Xnx7vqj0zOqQAQ29nF3prYr dF+PeRvCKGBeDAJV4oN9SCpxTb4D7Zz5U5Nl3L+Mpc4VEz2t++IRQAirUhiH4ytkC27O iX8LBulTcxeCQ13+6l06EoR2FxnApOfL+tT7uMztuTTMMN81zOMV2mXNmX91YWgtd85K 3DyXJonhJUeUP+jh1IaG2yzIbOS9/TPoNm5Lp419yY1BZCo/+Bj8BVLck7XIhCKrVrNA w0NuDq7t23obgvUR7PhGj/hmQkrBupWq5P6x2X9Z8oASGB88e/tErah+0W9BkKGNH/nK x9wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=QVkNBAiXkRxMy/qVjyHx/wruUfnbP9/mAC2GyGMcelg=; b=E79Wsm4R0P/GKXNayz1l/nyV1ozAeFUXvcr4i9Ex3CwktaVHyliJAbZZ10RBqUZJlp 066imuWaNSoxjZdKk7nov92KeAvHdWk1WbqYC4m4cBLYphMOpnloi/P4sNkSJA7hHpog EsaDfWIQZUT/U0WPoQ0k5mLPj6ij5dAsBi5kSokbsOjimhCckwW+TgUZkz4ahXWcA8Nb o4omCXW7yKDpZhse15tnR0We8c71Kz6KUZufzcx6w4HZ4FtqkPOGBlBPK/TuubOjkNVj RRtN2rCFY/bByBLJRKmPCAwiOrQcXjkrNm7F0zteIE8sJS/hxDQBf0Q53o6qs9jTb0n4 JiNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=g138aPBr; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id b4-v6si9188365pgu.79.2018.05.02.02.12.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 02:12:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=g138aPBr; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 77C3B6E52C; Wed, 2 May 2018 09:12:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A2E26E52A for ; Wed, 2 May 2018 09:12:09 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w429C66r001206; Wed, 2 May 2018 04:12:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1525252326; bh=YF8Il8DcqZBQLCVCqX38MIPsSVcG93/tRR8OB9NiNHU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=g138aPBrJzkP96Gwk8AEBszQ3ohSqbhoi4Ry1GaLBx7+lcpFa1gEujirrlCsyTEfA rI711wfWBhhGHQQnngIcFpWIOtbft2zkhn02z7gVC98iFV6GRIN/B8VbgyA26fGUoT RWUkWVVTwclVuqlBcptDpaNyWlo89yaPSsgURzVA= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w429C61n002404; Wed, 2 May 2018 04:12:06 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 2 May 2018 04:12:05 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 2 May 2018 04:12:05 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w429C3GG015655; Wed, 2 May 2018 04:12:04 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCH 1/4] drm/omap: check return value from soc_device_match Date: Wed, 2 May 2018 12:11:56 +0300 Message-ID: <20180502091159.7071-2-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180502091159.7071-1-tomi.valkeinen@ti.com> References: <20180502091159.7071-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" soc_device_match() can return NULL, so add a check and fail if soc_device_match() fails. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/hdmi4_core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c index 35ed2add6189..813ba42f2753 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c @@ -922,8 +922,13 @@ int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core) { const struct hdmi4_features *features; struct resource *res; + const struct soc_device_attribute *soc; - features = soc_device_match(hdmi4_soc_devices)->data; + soc = soc_device_match(hdmi4_soc_devices); + if (!soc) + return -ENODEV; + + features = soc->data; core->cts_swmode = features->cts_swmode; core->audio_use_mclk = features->audio_use_mclk;