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; From patchwork Wed May 2 09:11:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 134825 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp448739lji; Wed, 2 May 2018 02:12:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrd2roYH3j7RcI7K4cPmZuDQFV++kJlCrbT8tI/nvpO5z89U+sQilZHzWQJwVQldTq4P1Gy X-Received: by 2002:a63:6502:: with SMTP id z2-v6mr6445810pgb.159.1525252367593; Wed, 02 May 2018 02:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525252367; cv=none; d=google.com; s=arc-20160816; b=fqG6FtG1VmEy3H+e7ia4mt5A5aWd3TDSYF8Jel17cUCCw4gKbA8dCx+y51Zm4iZ7Wr 1ybD5XV8mRUELq3PFxrhMfqTP/erQKWBBa/mHA7g1uAwO81aK+OdcnQyMis/m314bA+e 3G4JEEXFbnHZJDqkFPCo42Wrd9xT0eKrjknKmxj857WUvkJBaztRZQClweMzoTS0OLYN jHGtqISYiX8KRUaqe4ofU7ubjRH7eiF+Ntzw51HbqehCdyJlBe8WSZimYUcqtlUmlDDB JCvSmKLceKqetMuNgnyl0TsagkRqdecgz/lwAsCbE3AnlsbX9ELZS8pA4gm1jrLyh45b SBtQ== 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=GGB+/yIbtLnNnYdpFZWwL8vrqLpJLD9auuu7QxRXC3E=; b=q6p5YhTZ3XxidlDw85/wE31v0X7fO3D5UBtEETQC0joQqLuVwpbdU5xA7sbFw/Uic5 n761ZFmLZhPv0+mk6bD+F3WRLH2+JmsVWEFRUWZuYVsWGyWrQCbXblxZO7pZ6bOYwyjg GqKga/LQ6O6PMvb1EpJs4knHP1mGix/yLXeo8dHTZuekrDC2krWp+kZkulgYgWktt8fn jrFcs0DtYCytAM3I1bnOkAdFtYVpiQk3wgLIRxsBwdogGiqUhni8oiH1IJrXbpur79+4 Emq9/dtefoh2trtaj70Jhv6fWBnslLC/5E9mgQzhnG1luJp6rJrFIqQpwbs9l+K16LW+ qu5g== 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=jDjpJpgX; 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 9-v6si11166357plf.283.2018.05.02.02.12.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 02:12:47 -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=jDjpJpgX; 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 14BED6E537; Wed, 2 May 2018 09:12:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 046BF6E52C for ; Wed, 2 May 2018 09:12:10 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w429C7VE021716; Wed, 2 May 2018 04:12:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1525252327; bh=fpdzhi5aShM58IDrSQg8gtQdvPu87Qc2RQxSlHQ3LU8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jDjpJpgX2njlgt1xdwjQ1m0jVL8LLno+FfkBIiAJmuR9dJ/TBFgOsuo4YX9llPEKS MEjAc07mvf1I9njkHw36f4ij9DriZYhpCi9gqMqyJtchYDyezd5uvPbRaRKM5kMEJA B/yYNHA+B0iiMlxjoR5IoNDS7ASrrFW9AblWxAf4= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w429C7UO013149; Wed, 2 May 2018 04:12:07 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) 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:06 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE113.ent.ti.com (157.170.170.24) 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:07 -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 w429C3GH015655; Wed, 2 May 2018 04:12:06 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCH 2/4] drm/omap: handle error if scale coefs are not found Date: Wed, 2 May 2018 12:11:57 +0300 Message-ID: <20180502091159.7071-3-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" If get_scale_coef functions fail, they return NULL, but we never check the return value and could do a NULL deref. This should not happen as we ought to validate the amount of scaling already earlier, but to be safe, add the necessary check. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dispc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 5e2e65e88847..b8fdb63e5bb3 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -828,6 +828,12 @@ static void dispc_ovl_set_scale_coef(struct dispc_device *dispc, h_coef = dispc_ovl_get_scale_coef(fir_hinc, true); v_coef = dispc_ovl_get_scale_coef(fir_vinc, five_taps); + if (!h_coef || !v_coef) { + dev_err(&dispc->pdev->dev, "%s: failed to find scale coefs\n", + __func__); + return; + } + for (i = 0; i < 8; i++) { u32 h, hv; From patchwork Wed May 2 09:11:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 134824 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp448702lji; Wed, 2 May 2018 02:12:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoeb/waoYx5c8YMTbavEHVXX4JewcwT7qabkVn31npz3UJsu9j04IBMyhJMr+5ahegAQvF6 X-Received: by 2002:a63:7c43:: with SMTP id l3-v6mr13722244pgn.0.1525252365698; Wed, 02 May 2018 02:12:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525252365; cv=none; d=google.com; s=arc-20160816; b=Zr2WPNJJ7WTYlVCgzC/XcpTOdubF0I7gH3mY9LdTVhW4vRxgVyuL/DMpW0XoQvGrIr WBzpJ1qbH/kmXRMn6kC7e5ujdocdCHgxi5paKR4tPG2jbhehkyi2V27gkFbd5XSxKmAU StD9Dc1EEEUhLy0/3eTPiEw5p3n+0uAFx7sLDQc0f9WQn4f1geZSaExBc4qVg0FV2gs4 OGo5ARdEniyVdWXVQkmQhwR6uiYGvfH0FgMHFr1d2zND4z/rs2OzmABobGbuYGCmC4FO ajsJZzvhCsioP2WnBIgjyxn0xF6vBdDrBorgP53Rf8zbKiux/IpL0CRf3rFWHMgtueF/ a4vw== 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=OcY4jx7MJ9ewk8lg1SzlTIwIL4IgcaafOpEZkH4SZhE=; b=WjSTmxiNpx2AxN+TNMg+VsjNxwdTzUt6zeDj4Msb9TuDCBw0/1iG0/SdbZ2B17PKYO 9u0fy2iYKy4Rgd/oLbgaWWjhb8PGyq3VVOmnpQLJ9GqMv6/XIUsko9SXwXA/tvSW4kcY 74aufusObBnjUUyS9AhnYvSM7lPqBiydU5/l7bgq3PCTiRj4H/wsFy6Xso9Mqcg9pDNR daMlIP5tKTHppFfffIiVLtGpZ1q/MMSFjMWgEghw1sFEjSVx48g0D+FyYkGHqJIoarCr b+3E/MD10rUpL0nwA6ofj50pWBEQ9T/tvhs6O5pitCvGRykmNqS6KFDj8brfMl6c3TNk 8cFg== 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=jfnBPH6Q; 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 m39-v6si11269928plg.570.2018.05.02.02.12.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 02:12:45 -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=jfnBPH6Q; 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 E1CA06E532; 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 2063D6E532 for ; Wed, 2 May 2018 09:12:11 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w429C8RT001214; Wed, 2 May 2018 04:12:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1525252328; bh=CHKro13qw0Gx2CzU9kVzR3MjcSi8nYISooXdJbAa8yY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jfnBPH6QypLmrYTYd+lwU6kq5cOthE/i4Gsmna6YjAaLODDpCpNgY1v/I4gYjDPOS HTzHFB9YKsl3q136z8VztR5MghPrRRpVZI+27PUxjf7GAcbqGXR1Mqfuhxa/pbeFXY IvDRsFjTUJFZ8h9FKhIXappswzJMwDNasYsH0vTM= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w429C8S0013170; Wed, 2 May 2018 04:12:08 -0500 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE100.ent.ti.com (10.64.6.21) 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:08 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE115.ent.ti.com (10.64.6.36) 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:08 -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 w429C3GI015655; Wed, 2 May 2018 04:12:07 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCH 3/4] drm/omap: add missing linefeeds to prints Date: Wed, 2 May 2018 12:11:58 +0300 Message-ID: <20180502091159.7071-4-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" A bunch of debug and error prints are missing linefeeds. Add those. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dispc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index b8fdb63e5bb3..7f3ac6b13b56 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -2348,7 +2348,7 @@ static int dispc_ovl_calc_scaling_24xx(struct dispc_device *dispc, } if (in_width > maxsinglelinewidth) { - DSSERR("Cannot scale max input width exceeded"); + DSSERR("Cannot scale max input width exceeded\n"); return -EINVAL; } return 0; @@ -2430,13 +2430,13 @@ static int dispc_ovl_calc_scaling_34xx(struct dispc_device *dispc, } if (in_width > (maxsinglelinewidth * 2)) { - DSSERR("Cannot setup scaling"); - DSSERR("width exceeds maximum width possible"); + DSSERR("Cannot setup scaling\n"); + DSSERR("width exceeds maximum width possible\n"); return -EINVAL; } if (in_width > maxsinglelinewidth && *five_taps) { - DSSERR("cannot setup scaling with five taps"); + DSSERR("cannot setup scaling with five taps\n"); return -EINVAL; } return 0; @@ -2478,7 +2478,7 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc, in_width > maxsinglelinewidth && ++*decim_x); if (in_width > maxsinglelinewidth) { - DSSERR("Cannot scale width exceeds max line width"); + DSSERR("Cannot scale width exceeds max line width\n"); return -EINVAL; } @@ -2496,7 +2496,7 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc, * bandwidth. Despite what theory says this appears to * be true also for 16-bit color formats. */ - DSSERR("Not enough bandwidth, too much downscaling (x-decimation factor %d > 4)", *decim_x); + DSSERR("Not enough bandwidth, too much downscaling (x-decimation factor %d > 4)\n", *decim_x); return -EINVAL; } @@ -4639,7 +4639,7 @@ static int dispc_errata_i734_wa_init(struct dispc_device *dispc) i734_buf.size, &i734_buf.paddr, GFP_KERNEL); if (!i734_buf.vaddr) { - dev_err(&dispc->pdev->dev, "%s: dma_alloc_writecombine failed", + dev_err(&dispc->pdev->dev, "%s: dma_alloc_writecombine failed\n", __func__); return -ENOMEM; } From patchwork Wed May 2 09:11:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 134823 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp448355lji; Wed, 2 May 2018 02:12:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpfTyHrK06vFXZBo3pyguK2jM/D7To8kKSahXkaDdD89ur2Qw6ps9mLsN4xqztkZTToc6qH X-Received: by 2002:a17:902:8692:: with SMTP id g18-v6mr19316193plo.152.1525252340487; Wed, 02 May 2018 02:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525252340; cv=none; d=google.com; s=arc-20160816; b=syOgrYdDKVFPCmL4eG2dLiqWEonBgpeS+Lx2UBCHhgFiPbgsNP8aRBpmHcJtEopxXw KnCgwjWHHrgfug1KeXqe82ntR3cAgyW4VA94v0NcIZxN50WQ8hu6DONEOO62HYynoCCU zN0/W7zjJdKCC8rUwlz7uxh5bbL6A9QLN1wu6Rf9Gjdo7a3A4XNMlsYjA/q/2PxyZj67 ZQZcK8O8i2HEPInMiuz0BdKdMGY6wuJWF2jveDNqXnaqQj8eIgaI0rW8nwgqlfTpr8Fz h4flXpYQbDp050B2fFCMcL8WpQh6IZiR+LkxxpUB76bo8knpqs/RClt8Ui3kSxELCySE HkSA== 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=+X+iquWHrq/9FBgO/HDAdhcGxiVVTQGWbXXfVpOruBs=; b=l+ZSyNkfEzxBimEApl3If6qqtPB2nruTxFiQwtEAwH+242HUApv7EfGH8v+vwcKArz gkmjobF7T+TlnBDnbGKWkokecqOo48DzyAEFS20OiwmAxG78sJ5KJIZZy06/N1CwuPhA ltZ+yshQmo+SK0gLIcPa1KDy7ge7ZUqBekvGZVvHoAWkyQFg8GO39ZMDChrRFNh7jkWk wFKtH4JBQOIxjs7DEmvIQN9UJi3iqxzNr5qdCH1sMkYU/coGbhDGwgvtn3m9RrVZkdB4 qAr3Ep1TJavsFPnu5u1SJMz80hwtraj+qM0uOa9a3/+UNptFPmkYDku+JFbFswU5T1DQ wuzw== 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=Z/u4libF; 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 m11-v6si9393729pgs.73.2018.05.02.02.12.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 02:12:20 -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=Z/u4libF; 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 AEF546E536; Wed, 2 May 2018 09:12:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelnx193.ext.ti.com (lelnx193.ext.ti.com [198.47.27.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id D9FAE6E536 for ; Wed, 2 May 2018 09:12:12 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w429CACk001708; Wed, 2 May 2018 04:12:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1525252330; bh=wQpEl/A6OcoEztDB+bayoqWS44lRErZ1jmQSGbGMKIQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Z/u4libFagBFyXUhEpy52XzIEOq48o27wE0EdAeGklrFsVcOxT+prDRhliJKMIJaU KV6acNSAp2vsMogzSnwsQaWyRD8aByadTcjsb9JmIoRUxeXpBz6X6UPQEPOO3oE5ay zkx6BdLWblqCqBl+BaTRnnQ5vFTlUximHvIv1S0c= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w429C9Th002504; Wed, 2 May 2018 04:12:09 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE104.ent.ti.com (157.170.170.34) 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:09 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE107.ent.ti.com (157.170.170.37) 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:09 -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 w429C3GJ015655; Wed, 2 May 2018 04:12:08 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCH 4/4] drm/omap: handle alloc failures in omap_connector Date: Wed, 2 May 2018 12:11:59 +0300 Message-ID: <20180502091159.7071-5-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" Handle memory allocation failures in omap_connector to avoid NULL derefs. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_connector.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index a0d7b1d905e8..5cde26ac937b 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c @@ -121,6 +121,9 @@ static int omap_connector_get_modes(struct drm_connector *connector) if (dssdrv->read_edid) { void *edid = kzalloc(MAX_EDID, GFP_KERNEL); + if (!edid) + return 0; + if ((dssdrv->read_edid(dssdev, edid, MAX_EDID) > 0) && drm_edid_is_valid(edid)) { drm_mode_connector_update_edid_property( @@ -139,6 +142,9 @@ static int omap_connector_get_modes(struct drm_connector *connector) struct drm_display_mode *mode = drm_mode_create(dev); struct videomode vm = {0}; + if (!mode) + return 0; + dssdrv->get_timings(dssdev, &vm); drm_display_mode_from_videomode(&vm, mode); @@ -200,6 +206,10 @@ static int omap_connector_mode_valid(struct drm_connector *connector, if (!r) { /* check if vrefresh is still valid */ new_mode = drm_mode_duplicate(dev, mode); + + if (!new_mode) + return MODE_BAD; + new_mode->clock = vm.pixelclock / 1000; new_mode->vrefresh = 0; if (mode->vrefresh == drm_mode_vrefresh(new_mode))