All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm: rcar-du: Fix a NULL vs IS_ERR() bug
Date: Mon, 27 Feb 2023 16:38:17 +0200	[thread overview]
Message-ID: <Y/zAWdgjKQjvdmXr@pendragon.ideasonboard.com> (raw)
In-Reply-To: <Y/yAw6sHu82OnOWj@kili>

Hi Dan,

Thank you for the patch.

On Mon, Feb 27, 2023 at 01:06:59PM +0300, Dan Carpenter wrote:
> The drmm_encoder_alloc() function returns error pointers.  It never
> returns NULL.  Fix the check accordingly.
> 
> Fixes: 7a1adbd23990 ("drm: rcar-du: Use drmm_encoder_alloc() to manage encoder")
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> index b1787be31e92..7ecec7b04a8d 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> @@ -109,8 +109,8 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
>  	renc = drmm_encoder_alloc(&rcdu->ddev, struct rcar_du_encoder, base,
>  				  &rcar_du_encoder_funcs, DRM_MODE_ENCODER_NONE,
>  				  NULL);
> -	if (!renc)
> -		return -ENOMEM;
> +	if (IS_ERR(renc))
> +		return PTR_ERR(renc);
>  
>  	renc->output = output;
>  

-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Dan Carpenter <error27@gmail.com>
Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Subject: Re: [PATCH] drm: rcar-du: Fix a NULL vs IS_ERR() bug
Date: Mon, 27 Feb 2023 16:38:17 +0200	[thread overview]
Message-ID: <Y/zAWdgjKQjvdmXr@pendragon.ideasonboard.com> (raw)
In-Reply-To: <Y/yAw6sHu82OnOWj@kili>

Hi Dan,

Thank you for the patch.

On Mon, Feb 27, 2023 at 01:06:59PM +0300, Dan Carpenter wrote:
> The drmm_encoder_alloc() function returns error pointers.  It never
> returns NULL.  Fix the check accordingly.
> 
> Fixes: 7a1adbd23990 ("drm: rcar-du: Use drmm_encoder_alloc() to manage encoder")
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> index b1787be31e92..7ecec7b04a8d 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> @@ -109,8 +109,8 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
>  	renc = drmm_encoder_alloc(&rcdu->ddev, struct rcar_du_encoder, base,
>  				  &rcar_du_encoder_funcs, DRM_MODE_ENCODER_NONE,
>  				  NULL);
> -	if (!renc)
> -		return -ENOMEM;
> +	if (IS_ERR(renc))
> +		return PTR_ERR(renc);
>  
>  	renc->output = output;
>  

-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2023-02-27 14:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 10:06 [PATCH] drm: rcar-du: Fix a NULL vs IS_ERR() bug Dan Carpenter
2023-02-27 10:06 ` Dan Carpenter
2023-02-27 11:31 ` Kieran Bingham
2023-02-27 11:31   ` Kieran Bingham
2023-02-27 14:38 ` Laurent Pinchart [this message]
2023-02-27 14:38   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/zAWdgjKQjvdmXr@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.