From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH v2 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer Date: Thu, 4 Oct 2018 21:54:06 +0200 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/mixed; boundary="===============0621769544==" Return-path: Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C5A26E650 for ; Thu, 4 Oct 2018 19:54:08 +0000 (UTC) In-Reply-To: <20181003142458.33120-1-giulio.benetti@micronovasrl.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Giulio Benetti Cc: David Airlie , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org --===============0621769544== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="opjbizbyovgucput" Content-Disposition: inline --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-- --===============0621769544== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0621769544==--