staging: gs_fpgaboot: Fix "out of memory" error handling
authorDzmitry Sledneu <dzmitry.sledneu@gmail.com>
Thu, 9 Oct 2014 07:22:43 +0000 (09:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:30:13 +0000 (10:30 +0800)
Fix "out of memory" error handling

Signed-off-by: Dzmitry Sledneu <dzmitry.sledneu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gs_fpgaboot/gs_fpgaboot.c

index cbf70cefe6f568e8955898add69277bdc5f52541..0c18c4c311b4f2f4399663ed97cb2df1b6b6ab05 100644 (file)
@@ -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;
 
 }