[PATCH] video/fbdev/stifb: Delete an error message for a failed memory allocation in stifb_init_fb()

Rolf Eike Beer eike-kernel at sf-tec.de
Fri Nov 24 21:30:34 UTC 2017


Markus Elfring wrote:
> From: Markus Elfring <elfring at users.sourceforge.net>
> Date: Fri, 24 Nov 2017 22:22:06 +0100
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring at users.sourceforge.net>
> ---
>  drivers/video/fbdev/stifb.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c
> index 6ded5c198998..fe217a2f7d21 100644
> --- a/drivers/video/fbdev/stifb.c
> +++ b/drivers/video/fbdev/stifb.c
> @@ -1126,10 +1126,8 @@ static int __init stifb_init_fb(struct sti_struct
> *sti, int bpp_pref) int bpp, xres, yres;
> 
>  	fb = kzalloc(sizeof(*fb), GFP_ATOMIC);
> -	if (!fb) {
> -		printk(KERN_ERR "stifb: Could not allocate stifb structure\n");
> +	if (!fb)
>  		return -ENODEV;
> -	}
> 
>  	info = &fb->info;

This should be -ENOMEM.

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20171124/4f0d913d/attachment-0001.sig>


More information about the dri-devel mailing list