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] [thread-next>] [day] [month] [year] [list]
Message-ID: <c15282b4-e88a-06b1-527d-96aedce8b7eb@wanadoo.fr>
Date:   Sun, 30 Oct 2016 12:53:02 +0100
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     maxime.ripard@...e-electrons.com, airlied@...ux.ie, wens@...e.org
Cc:     dri-devel@...ts.freedesktop.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] drm/sun4i: Fix error handling

Hi,

BTW, memory allocation in 'sun4i_layers_init()' looks spurious, 
especially the use of 'layer' in the for loop.
Just my 2 cents.


I also forgot to say that we could propagate the error code returned by 
sun4i_layers_init instead of returning -EINVAL unconditionally

CJ




Le 30/10/2016 à 09:49, Christophe JAILLET a écrit :
> 'sun4i_layers_init()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET<christophe.jaillet@...adoo.fr>
> ---
>   drivers/gpu/drm/sun4i/sun4i_drv.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
> index 9776f0305834..628712e6edd6 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
> @@ -143,7 +143,7 @@ static int sun4i_drv_bind(struct device *dev)
>   
>   	/* Create our layers */
>   	drv->layers = sun4i_layers_init(drm);
> -	if (!drv->layers) {
> +	if (IS_ERR(drv->layers)) {
>   		dev_err(drm->dev, "Couldn't create the planes\n");
>   		ret = -EINVAL;
>   		goto free_drm;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ