Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1833897imm; Tue, 2 Oct 2018 15:00:20 -0700 (PDT) X-Google-Smtp-Source: ACcGV61JzGjGIDFnR0q5YeSZPu5zE8plVz13zaHdm9GBWG8J3Sza3ea62RCNZ85Lys11zBJfOFKO X-Received: by 2002:a63:595:: with SMTP id 143-v6mr16109165pgf.244.1538517620238; Tue, 02 Oct 2018 15:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538517620; cv=none; d=google.com; s=arc-20160816; b=WYS4eM1fhWAGz788IhkpjpPCyLaTo+ObMJOwfnxaosfimpN0OIchZbK5jCryjd12TV N4/yWr8HBRPaVEINc7z2GGLcmmsvv8PpjFroyIIBg7RMEekoR0ebFhxzLoIPdC1C6QjC NK8MsoWF/AZSLeKsepLNHGMoFUa1XFH/83Rlg/Gcb5UMHx00VMCGHlEtzxt8gm0vF9DT DAauCwjiaRUk6mAUFfG4lpesmAMlI0E5r+WuvxG8u0D6kEEyMUo5bFMHGWcS8OoySMV1 BbCphdbmZlgk3rg/8dOCG6hjC1ev2jygO1vPNGZTl9LgKF9GDW2iFP7VN9bQeD13c0Oa YItw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=osoIjRvfo1nqYjUE1OrHLAZNvoxnx95ubRYsYylzjp8=; b=JUj6GrLCCjyRBQs2kJM5tDCybhQBrQys5oXizdnEyXZT1tQQOgVhKJutze6/qShUd+ 4AE0VG7MlKsLXwJx8XDaaTF47PbkrjxbAzU5lXPG3u4omU9LZTh5GlxwDqFZSZs653vb 0TgNkuYQekdizU+XMYqjM4+nosYQ3tu/32rTyp00gJuIPlM0KJVrBqrOBx59HzSwu0bB 1GBf3ebNLzFVeRfKfU90OyfV6QKCOgPKgJvDBBGe69/I7Byc3gcScnPY73MXKxGDt7q0 egFFzelPizbyuaik+E0jPn8b6aPt5i9OKGZ24A5DF5ir58srx7cO2x3MrXTn8En8Secq nqig== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=phHCXPHv; 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 o15-v6si17201940pgf.253.2018.10.02.15.00.05; Tue, 02 Oct 2018 15:00:20 -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; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=phHCXPHv; 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 S1728344AbeJCEow (ORCPT + 99 others); Wed, 3 Oct 2018 00:44:52 -0400 Received: from mail.micronovasrl.com ([212.103.203.10]:35772 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbeJCEow (ORCPT ); Wed, 3 Oct 2018 00:44:52 -0400 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id BF2BCB00C3B for ; Tue, 2 Oct 2018 23:59:21 +0200 (CEST) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=references:in-reply-to:x-mailer:message-id:date:date:subject :subject:to:from:from; s=dkim; t=1538517561; x=1539381562; bh=0a zMu6Ww48q352jv+MAfjeImAqkhQeep+ozCDFqNfv8=; b=phHCXPHvyog+sPHCpk cguU2Jh1h8zm3GlLfLg9YurVdMHwM10CUaoKOZSyDFxwxOusfmd7N5qrp7gUaHsp TNgZgU37DtAZFKhK1JhBMfNmcGREALNCMR/EfoktvbNafH5fif4bwv2SJ4YtFVrk kFHpU+lutKgTYOqYsFP2lZnZ0= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-10 required=4.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=unavailable autolearn_force=no Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YoBRuC5b3xx0 for ; Tue, 2 Oct 2018 23:59:21 +0200 (CEST) Received: from ubuntu.localdomain (146-241-101-147.dyn.eolo.it [146.241.101.147]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 39FF4B00750; Tue, 2 Oct 2018 23:59:20 +0200 (CEST) From: Giulio Benetti To: Maxime Ripard Cc: David Airlie , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dan Carpenter , Giulio Benetti Subject: [PATCH 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer Date: Tue, 2 Oct 2018 23:59:16 +0200 Message-Id: <20181002215917.1849-1-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181001093612.GA13672@mwanda> References: <20181001093612.GA13672@mwanda> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At the moment, the check of tcon->panel to be valid is wrong. IS_ERR() has been used, but that macro doesn't check if tcon->panel pointer is null or not, but check if tcon->panel is between -1 and -4095(MAX_ERRNO). Remove IS_ERR() from tcon->panel checking and let "if (tcon->panel)" as condition to check if it's a pointer not null. Signed-off-by: Giulio Benetti --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index c78cd35a1294..e4b3bd0307ef 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -555,7 +555,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, * Following code is a way to avoid quirks all around TCON * and DOTCLOCK drivers. */ - if (!IS_ERR(tcon->panel)) { + if (tcon->panel) { struct drm_panel *panel = tcon->panel; struct drm_connector *connector = panel->connector; struct drm_display_info display_info = connector->display_info; -- 2.17.1