Messages in this thread |  | | Date | Thu, 4 Oct 2018 21:54:06 +0200 | From | Maxime Ripard <> | Subject | Re: [PATCH v2 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer |
| |
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). > > 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 <giulio.benetti@micronovasrl.com>
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
-- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com [unhandled content-type:application/pgp-signature] |  |