kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] drm/omap: checking for NULL instead of IS_ERR()
@ 2015-07-31  9:33 Dan Carpenter
  2015-07-31  9:58 ` Archit Taneja
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-07-31  9:33 UTC (permalink / raw)
  To: David Airlie, Archit Taneja
  Cc: Daniel Vetter, kernel-janitors, dri-devel, Fabian Frederick,
	Tomi Valkeinen, Laurent Pinchart, Thierry Reding

We recently start using the new drm_fb_helper functions but the error
handling needs to be updated as well to check for IS_ERR() instead of
NULL.

Fixes: 377eb331375f ('drm/omap: Use new drm_fb_helper functions')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index 08ef090..b8e4cde 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -180,9 +180,9 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
 	mutex_lock(&dev->struct_mutex);
 
 	fbi = drm_fb_helper_alloc_fbi(helper);
-	if (!fbi) {
+	if (IS_ERR(fbi)) {
 		dev_err(dev->dev, "failed to allocate fb info\n");
-		ret = -ENOMEM;
+		ret = PTR_ERR(fbi);
 		goto fail_unlock;
 	}
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] drm/omap: checking for NULL instead of IS_ERR()
  2015-07-31  9:33 [patch] drm/omap: checking for NULL instead of IS_ERR() Dan Carpenter
@ 2015-07-31  9:58 ` Archit Taneja
  0 siblings, 0 replies; 2+ messages in thread
From: Archit Taneja @ 2015-07-31  9:58 UTC (permalink / raw)
  To: Dan Carpenter, David Airlie
  Cc: Daniel Vetter, kernel-janitors, dri-devel, Fabian Frederick,
	Tomi Valkeinen, Laurent Pinchart, Thierry Reding

Hi,

On 07/31/2015 03:03 PM, Dan Carpenter wrote:
> We recently start using the new drm_fb_helper functions but the error
> handling needs to be updated as well to check for IS_ERR() instead of
> NULL.
>
> Fixes: 377eb331375f ('drm/omap: Use new drm_fb_helper functions')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
> index 08ef090..b8e4cde 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
> @@ -180,9 +180,9 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
>   	mutex_lock(&dev->struct_mutex);
>
>   	fbi = drm_fb_helper_alloc_fbi(helper);
> -	if (!fbi) {
> +	if (IS_ERR(fbi)) {
>   		dev_err(dev->dev, "failed to allocate fb info\n");
> -		ret = -ENOMEM;
> +		ret = PTR_ERR(fbi);
>   		goto fail_unlock;
>   	}

I was going to post out a v3 for this set. I'll squash this and mention
the fix in the changelog.

Thanks,
Archit

>
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-31  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31  9:33 [patch] drm/omap: checking for NULL instead of IS_ERR() Dan Carpenter
2015-07-31  9:58 ` Archit Taneja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).