Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1393554imm; Thu, 4 Oct 2018 12:54:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV6035tiAN4MypZNeOtWugQGXj7HjA6/vpdVAyA0bmFTqLAPV7SvIsuTsi4yBJgDpW96FkKpq X-Received: by 2002:a62:9850:: with SMTP id q77-v6mr8064023pfd.249.1538682871268; Thu, 04 Oct 2018 12:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538682871; cv=none; d=google.com; s=arc-20160816; b=Rt0wkpVCc3Rkdxf2Zd/xRNDlmHng8QYPJZ7TWlmGkwjxnTqXEo1uRbnBRRTjroC3eB iUhIDDDoIk6zW+NVFXtshDZTuiheXOL4pvtD8mgV0neVncrwczKmNpAsG4jgXPioLQ7H xX2pXjSLDllLl5fYdrx2q3n1aFAF6mWew2I/uKqA689jLeMF9Bt0BsKrgXrspchlYQOE HMZ+TiRpOEf9UNWDA8Vo/nHr4xvrbT2ihfzubBsf8s/ALqCl2qSTNOIntGklPNw7h8g9 Iqd0U281xZWgh5z/ci6Df+g4PXYuf7glOF/MulPV6Ny5eY68Y4F2pZRO3IsEyGs48WUD OM3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4wDN5bOfN65jDJxq8uF2LQSy3ybX1LT5IGh9aPKKwpg=; b=TeO9il7AjtUH+840/3d2mGroNjtrkCFcoSLXCQH1jAInMxHT9G+jp8Gl/Q/G+Iy1wm 9pW0Nncphljg7NnahOKggpZHgYo6mZ4ondpbeezXTP83+umayLYMgtDYVLUjNiECIarW uF8CH6TEPCnpW9MGlTMGga2J53XU7PeFhqVOboalPIORmbEeVrwFdrUYfQiQmw43/AQk E6Gm/71W4gp38i6nTmokmIMqp6vrF50l7pT0aKTNSWcryuDDOskwE2oLhSG0uJ+i0Qva BbCrh58kREugQPhaA6rP7ChKcsIpixG2W3o7o/SOSOyMr0O7Awpte0TAVYPo8crZPuGD PLMQ== ARC-Authentication-Results: i=1; mx.google.com; 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 i21-v6si5193975pgh.53.2018.10.04.12.54.15; Thu, 04 Oct 2018 12:54:31 -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; 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 S1727536AbeJECsz (ORCPT + 99 others); Thu, 4 Oct 2018 22:48:55 -0400 Received: from mail.bootlin.com ([62.4.15.54]:51555 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbeJECsz (ORCPT ); Thu, 4 Oct 2018 22:48:55 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 7642A207F3; Thu, 4 Oct 2018 21:54:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LFbn-1-10718-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.bootlin.com (Postfix) with ESMTPSA id 46668206FF; Thu, 4 Oct 2018 21:54:06 +0200 (CEST) Date: Thu, 4 Oct 2018 21:54:06 +0200 From: Maxime Ripard To: Giulio Benetti Cc: David Airlie , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer Message-ID: <20181004195406.prjuko556tnuau2u@flea> References: <9a545739-eed5-7af1-3b75-108bdd3427a2@micronovasrl.com> <20181003142458.33120-1-giulio.benetti@micronovasrl.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="opjbizbyovgucput" Content-Disposition: inline In-Reply-To: <20181003142458.33120-1-giulio.benetti@micronovasrl.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --opjbizbyovgucput Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Oct 03, 2018 at 04:24:57PM +0200, 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). >=20 > Remove IS_ERR() from tcon->panel checking and let "if (tcon->panel)" as > condition to check if it's a pointer not null. >=20 > Signed-off-by: Giulio Benetti The commit log should be improved. The issue isn't really with the IS_ERR macro as you suggest, but that what is returned by of_drm_find_panel, and thus stored in tcon->panel. is not an error pointer in the first place but a NULL pointer on error. So the check doesn't check for the proper thing. Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --opjbizbyovgucput Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlu2b90ACgkQ0rTAlCFN r3SECg/8C8s1dR1+g7QU0KMFTa1z6f1VKKe7qQV1le5xEG4b9NdltxS3NNjg70bn mAushukubUMuhx01QT1cio8X7ANl605+2m1UGzVsHqLXayv+gW2DtfAx1TLvQgDp tTQG+EG/vmplrs2pI4n0LBHfetQmWbT3wjqcTV/XzFHqOQMOD3Bs7Ig0hq+9FTPJ xSMcVvHVhHpB6yNdixoXPTeziIuv9ywnRd/0BoafMmM1KV4acfsAfLOYbGR3uvGF hl8MoDbGZwXlmvplM//HI96P7qmy9YJun4hXnkJ17IeC1tHWUbEb8TLEhuesTFfN 92TKoNO1ZI44Hfjsl52dgVrFTGMdMxdGxvNFX9kNsBIVLgvynwQfQ4CL2JKISvbp QSg1Kc5U4O55TX6fm4vJoXvCeFccCB1R2HLnk6ygmysvp/4p3Mm3srKMeVnqQw0Y REOjWt7dqX17d3RTn4Tg+c1vlTzuBPeO7iwRK0hSencm06epl4Ym0Eyaxdv3Imjh qrSXlHfvqdKpKV/xrvLFnsHIyGvNkmle/vYFI55XADO3ii3PSvd8OkrY0lgVwd6U h1tN2povQz2XtnplXK0cX6YZN98QZ5gxgzRj832Lbxp5aNy+9KMRNVgELCtEbiJe /8yYGnbHV0Qn5BwRxBVlh/8Nja1FNZN6aMSxhp0fEBjJKGTwHFk= =spN4 -----END PGP SIGNATURE----- --opjbizbyovgucput--