Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2517013imm; Wed, 3 Oct 2018 05:15:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV61bUixzgfNuaQaWYIsIeZFMzQIdeyRo3Y4LErxfONr3rLcSow66LJ8xFNWfP8zC/x8K4VZ/ X-Received: by 2002:a17:902:8d95:: with SMTP id v21-v6mr1348512plo.21.1538568941794; Wed, 03 Oct 2018 05:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538568941; cv=none; d=google.com; s=arc-20160816; b=Ma7szCePcorERnbGQgqH/UHFMdBWFpMvtUJt1GZgwRY+nrKniiKar0mz23OldRLFDK /rWEuYDf0E3E1scDzcZ4glwwPIlz7zSFJOdW3LZcLNT747Ud07nPeKHLgz8bMA5AzPWo QAsz/05K1iw2rm0ef7PS69SuVYCBpRGU5AG6sGpdszyRcUbTxJBJge7/jGYDP7vxxLjH 4UJ6g38KvlXorbIO4UhZPSwxvnbApVIuVPP1I3cBUIMC7Z5XysaJ5BwMTAx5ATyNN5f/ iUzklSOWVVJ6Of5Pgl/bcqtH83nSlVKwT6h7ZCjY0nOh/fH3JHPNCFcGyCX6Z3eDHTIX fyww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=0GkTfQYXYOWHvTaRM/KrkFaS/eIufYBZ8UrTwC7iFAs=; b=IW52UEjIvAIptxrXavok+8XE1g+qcOIefVBHpn1HvGMbx8apyZsqLwi/EMGChUHd36 ER+N723HpWhmQXFLtRy3gL6/EafTos3RmCB0j5Iboqd7OCnoWezqG6v/ebMQtcfRTGXr l2/KA0ZItVf5DmOFZfH0A+rL+NuWIMsbP445eEAOh08VF9BEdl3WgiPwsOprI+Lt3yuI yyCB5UVuLL8JNyr/3rrTr7xkLaBkuKXDPtJulRKaCRyiVkQeU6dTtuyPPnJaLQRjOU6n x5F29n++8/omb7kYoNSshCrsNbG9vngTa97U3yHTUtOUACPO4Keww5i1p5OOURiOKZOb +DXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=A4QH6hMG; 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 y20-v6si1392812plr.83.2018.10.03.05.15.26; Wed, 03 Oct 2018 05:15:41 -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=A4QH6hMG; 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 S1726801AbeJCTCJ (ORCPT + 99 others); Wed, 3 Oct 2018 15:02:09 -0400 Received: from mail.micronovasrl.com ([212.103.203.10]:58656 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726547AbeJCTCJ (ORCPT ); Wed, 3 Oct 2018 15:02:09 -0400 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id D4911B00A75 for ; Wed, 3 Oct 2018 14:13:59 +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=content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:to:subject:subject; s=dkim; t= 1538568839; x=1539432840; bh=c2HRf60Ewcj7zRu4Bhmq+ouHmj2YqpXj/RA m+PWbIOE=; b=A4QH6hMGjxO/fc0T37QJDPpl9qMHQxnZA2sIrkUVuDIgROGSUU9 8O+xUJCvjSDJR9FXjemLWpsnihS+Ay/9NcfZfy1qcIk9bNfOTWkiR/v5jfujWszz xeFNgZCiWcJB5Q8mfe/HwkeF+PZxLTj0wCoKt+zfscFHZ71lkNDpSVRU= 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 NWTl1fVZdI1u for ; Wed, 3 Oct 2018 14:13:59 +0200 (CEST) Received: from [192.168.0.105] (146-241-101-147.dyn.eolo.it [146.241.101.147]) by mail.micronovasrl.com (Postfix) with ESMTPSA id DD917B00568; Wed, 3 Oct 2018 14:13:54 +0200 (CEST) Subject: Re: [PATCH 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer To: Chen-Yu Tsai Cc: Maxime Ripard , linux-kernel , dri-devel , David Airlie , linux-arm-kernel , Dan Carpenter References: <20181001093612.GA13672@mwanda> <20181002215917.1849-1-giulio.benetti@micronovasrl.com> From: Giulio Benetti Message-ID: <9a545739-eed5-7af1-3b75-108bdd3427a2@micronovasrl.com> Date: Wed, 3 Oct 2018 14:13:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: it Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 03/10/2018 11:43, Chen-Yu Tsai ha scritto: > On Wed, Oct 3, 2018 at 5:59 AM Giulio Benetti > wrote: >> >> 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. > > There's actually more than one occurance of this error: > > drivers/gpu/drm/sun4i/sun4i_lvds.c: if (!IS_ERR(tcon->panel)) { > drivers/gpu/drm/sun4i/sun4i_lvds.c: if (!IS_ERR(tcon->panel)) { > drivers/gpu/drm/sun4i/sun4i_rgb.c: if (!IS_ERR(tcon->panel)) { > drivers/gpu/drm/sun4i/sun4i_rgb.c: if (!IS_ERR(tcon->panel)) { > > These four are responsible for enabling and disabling the panel. > > drivers/gpu/drm/sun4i/sun4i_tcon.c: if (!IS_ERR(tcon->panel)) { > > All this looks like it was left over from commit ebc9446135671 ("drm: convert > drivers to use drm_of_find_panel_or_bridge"). We have checks against tcon->panel > in several places and not all of them were converted. > Then, I'm going to send a patchset to correct them. Best regards -- Giulio Benetti CTO MICRONOVA SRL Sede: Via A. Niedda 3 - 35010 Vigonza (PD) Tel. 049/8931563 - Fax 049/8931346 Cod.Fiscale - P.IVA 02663420285 Capitale Sociale € 26.000 i.v. Iscritta al Reg. Imprese di Padova N. 02663420285 Numero R.E.A. 258642