From: Dzmitry Sledneu <dzmitry.sledneu@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joe Perches <joe@perches.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v4] staging: gs_fpgaboot: Fix "out of memory" error handling
Date: Thu, 09 Oct 2014 09:22:43 +0200 [thread overview]
Message-ID: <543637C3.5010009@gmail.com> (raw)
In-Reply-To: <54363737.50700@gmail.com>
Fix "out of memory" error handling
Signed-off-by: Dzmitry Sledneu <dzmitry.sledneu@gmail.com>
---
drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
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;
}
--
2.1.2
prev parent reply other threads:[~2014-10-09 7:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-07 14:37 [PATCH 001/002] staging: gs_fpgaboot: Fix "Possible unnecessary KERN_INFO" checkpatch.pl warning Dzmitry Sledneu
2014-10-07 14:39 ` [PATCH 002/002] staging: gs_fpgaboot: Fix "Possible unnecessary 'out of memory' message" " Dzmitry Sledneu
2014-10-07 15:23 ` [PATCH v2 1/2] staging: gs_fpgaboot: Fix "Possible unnecessary KERN_INFO" " Dzmitry Sledneu
2014-10-07 15:24 ` [PATCH v2 2/2] staging: gs_fpgaboot: Fix "Possible unnecessary 'out of memory' message" " Dzmitry Sledneu
2014-10-07 15:30 ` [PATCH v2 1/2] staging: gs_fpgaboot: Fix "Possible unnecessary KERN_INFO" " Joe Perches
2014-10-07 15:53 ` [PATCH v3 1/2] staging: gs_fpgaboot: Use print_hex_dump_bytes instead of pr_info Dzmitry Sledneu
2014-10-07 15:54 ` [PATCH v3 2/2] staging: gs_fpgaboot: Fix "Possible unnecessary 'out of memory' message" checkpatch.pl warning Dzmitry Sledneu
2014-10-08 22:48 ` Greg Kroah-Hartman
2014-10-09 7:20 ` Dzmitry Sledneu
2014-10-09 7:22 ` Dzmitry Sledneu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=543637C3.5010009@gmail.com \
--to=dzmitry.sledneu@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome