From: Markus Elfring Date: Wed, 28 Mar 2018 14:34:27 +0000 (+0200) Subject: video/fbdev/stifb: Return -ENOMEM after a failed kzalloc() in stifb_init_fb() X-Git-Tag: v4.17-rc1~63^2~17 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f9815f945aff2204b8afbbb9d2182024eb44a194;p=linux.git video/fbdev/stifb: Return -ENOMEM after a failed kzalloc() in stifb_init_fb() Replace an error code for the indication of a memory allocation failure in this function. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2: Initial git repository build") Suggested-by: Rolf Eike Beer Signed-off-by: Markus Elfring Cc: Helge Deller Cc: "James E. J. Bottomley" Signed-off-by: Bartlomiej Zolnierkiewicz --- diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c index 6ded5c198998..511a594889af 100644 --- a/drivers/video/fbdev/stifb.c +++ b/drivers/video/fbdev/stifb.c @@ -1128,7 +1128,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) fb = kzalloc(sizeof(*fb), GFP_ATOMIC); if (!fb) { printk(KERN_ERR "stifb: Could not allocate stifb structure\n"); - return -ENODEV; + return -ENOMEM; } info = &fb->info;