From: Dzmitry Sledneu Date: Thu, 9 Oct 2014 07:22:43 +0000 (+0200) Subject: staging: gs_fpgaboot: Fix "out of memory" error handling X-Git-Tag: v5.15~16669^2~1088 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02c2d43c2615ddc5d6e25f071b0f8d39ebc2d35d;p=platform%2Fkernel%2Flinux-starfive.git staging: gs_fpgaboot: Fix "out of memory" error handling Fix "out of memory" error handling Signed-off-by: Dzmitry Sledneu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c index cbf70ce..0c18c4c 100644 --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c @@ -295,8 +295,8 @@ static int gs_fpgaboot(void) struct fpgaimage *fimage; fimage = kmalloc(sizeof(struct fpgaimage), GFP_KERNEL); - if (fimage == NULL) - goto err_out; + if (!fimage) + return -ENOMEM; err = gs_load_image(fimage, file); if (err) { @@ -338,7 +338,6 @@ err_out2: err_out1: kfree(fimage); -err_out: return -1; }