From patchwork Wed May 18 21:06:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 9124701 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 33364BF29F for ; Thu, 19 May 2016 08:00:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58B8120225 for ; Thu, 19 May 2016 08:00:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4548B20279 for ; Thu, 19 May 2016 08:00:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EDA3B6E942; Thu, 19 May 2016 08:00:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id 024CA6E8EC; Wed, 18 May 2016 21:06:22 +0000 (UTC) Received: from LT001.lan ([62.143.92.134]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MY75A-1b7UFe3Jc8-00Utyk; Wed, 18 May 2016 23:06:18 +0200 From: Heinrich Schuchardt To: David Airlie , Rob Clark Subject: [PATCH 1/1] drm/msm/mdp4: avoid possible null pointer dereference Date: Wed, 18 May 2016 23:06:10 +0200 Message-Id: <1463605570-5441-1-git-send-email-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.1.4 X-Provags-ID: V03:K0:L7QH1h8yacvgtCjysuFAf3e9FeBB1cP9OQzbNMyPsps5hE/xdEt GNOj2kMG8Y16rcH/C0r19ZPw/Mqmjrp7kU5jDtKZtcuwtxvoUhIBtHfZN8G4vuSIcHsfmeN 92Q63zwA4MOimDZ8wRR3l2Rf9QvnH9m3CSFoMC8SOtonSy0RvZiOgKknX22ubhjwbOONagq QufvbLhl51RJHS7eJqkBA== X-UI-Out-Filterresults: notjunk:1; V01:K0:mG69frWECzM=:D/cj3jJTDZaw3Qccrexm7m jtNRKj7i8aWHwZlXHTeeK5rLcTZlM8+jIkndWbkpwyVaLGBkZFb5N+8tIDuBEHI9dwUgVxBoD udGkfC0WM82lJF/XoVBlu0md6ShOmi8QVb/+bMLSHBZF0atG9n3LdsBOb+WQCbSoG17iSfIth 4lLqWBSszNtZX5qq4UBMHvnEbqrLpN1DfvgOAT1SdKf5vJnhWCQxjT46WGEhGqjECHnCQrOgM 6T4l0E3yKm6OviOef6v4uMoQmTDmoU/VHROkLwrVfG2F97zLHNU0LplZ9U+oCVxkkuVXbF0dy CcQfCAqK0UoOOQ0pS6pBhPJnNPWeaioMKBTwdAFiNjXxM0z6zMUzw5HKYCdOp4b/LZmAsk/5j ocwSvEdMtHhj/JtthzsT2NqfnK6FH6LjKqj4xJ73rOcRFAk55N0Akcn4gM9jVBf6ArMw6ia04 XiWIjD0QHkD9nj44MbAdOaWWcdSBLT6GiRuZYR11XX5RHkI3oc05049MXmENlWS3EtH3T0bp3 oo8102gIW5OIzC3hz5HWF9QxaWLR8KzDW+BQMnB/5QEzFUfsD1Kb22dt94kwSqD8EjCw+xbKB aw1Bo2uTuRXtigbZ+wn3We0FMHKKS/oIZKjIJQtqKhuEcZuiGbqkyzVB2Gr2CZvVyES9S2fs2 YJx0MKnE+2w6ytwBn+0xMS7lGkiZPUWTTzFnPiM7bTltnpuJL3cksAXzViLIODAEQ+krjsvWK ItV04qytLaD24NxVusXvI3K77Ape1osQocKZ3ffrMXn0m1vdxHL6z3URkTA= X-Mailman-Approved-At: Thu, 19 May 2016 08:00:20 +0000 Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Heinrich Schuchardt X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do not dereference pll_rate before checking if it is NULL. Signed-off-by: Heinrich Schuchardt --- drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c index ce42459..bd10ffe 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_pll.c @@ -72,11 +72,11 @@ static int mpd4_lvds_pll_enable(struct clk_hw *hw) const struct pll_rate *pll_rate = find_rate(lvds_pll->pixclk); int i; - DBG("pixclk=%lu (%lu)", lvds_pll->pixclk, pll_rate->rate); - if (WARN_ON(!pll_rate)) return -EINVAL; + DBG("pixclk=%lu (%lu)", lvds_pll->pixclk, pll_rate->rate); + mdp4_write(mdp4_kms, REG_MDP4_LCDC_LVDS_PHY_RESET, 0x33); for (i = 0; pll_rate->conf[i].reg; i++)