lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20121021085454.GC27665@pengutronix.de>
Date:	Sun, 21 Oct 2012 10:54:54 +0200
From:	Sascha Hauer <s.hauer@...gutronix.de>
To:	Thierry Reding <thierry.reding@...onic-design.de>
Cc:	David Airlie <airlied@...ux.ie>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Lars-Peter Clausen <lars@...afoo.de>,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] drm: fb: cma: Fail gracefully on allocation failure

On Sat, Oct 20, 2012 at 12:32:47PM +0200, Thierry Reding wrote:
> The drm_gem_cma_create() function never returns NULL but rather an error
> encoded in the return value using the ERR_PTR() macro. Callers therefore
> need to check for errors using the IS_ERR() macro. This change allows
> drivers to handle contiguous DMA allocation failures gracefully.
> 
> Signed-off-by: Thierry Reding <thierry.reding@...onic-design.de>

Acked-by: Sascha Hauer <s.hauer@...gutronix.de>

Sascha

> ---
>  drivers/gpu/drm/drm_fb_cma_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
> index d6c80a3..fd9d0af 100644
> --- a/drivers/gpu/drm/drm_fb_cma_helper.c
> +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
> @@ -220,7 +220,7 @@ static int drm_fbdev_cma_create(struct drm_fb_helper *helper,
>  
>  	size = mode_cmd.pitches[0] * mode_cmd.height;
>  	obj = drm_gem_cma_create(dev, size);
> -	if (!obj)
> +	if (IS_ERR(obj))
>  		return -ENOMEM;
>  
>  	fbi = framebuffer_alloc(0, dev->dev);
> -- 
> 1.7.12.4
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ