From: Chaehyun Lim <chaehyun.lim@gmail.com>
To: gregkh@linuxfoundation.org
Cc: johnny.kim@atmel.com, rachel.kim@atmel.com, chris.park@atmel.com,
devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org,
Chaehyun Lim <chaehyun.lim@gmail.com>
Subject: [PATCH 2/5] staging: wilc1000: linux_wlan.c: add kzalloc error check
Date: Tue, 8 Sep 2015 00:36:36 +0900 [thread overview]
Message-ID: <1441640199-1507-2-git-send-email-chaehyun.lim@gmail.com> (raw)
In-Reply-To: <1441640199-1507-1-git-send-email-chaehyun.lim@gmail.com>
This patch adds error check if kzalloc is failed.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/staging/wilc1000/linux_wlan.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index f7dda75..76c48a4 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2270,6 +2270,8 @@ int wilc_netdev_init(void)
/*create the common structure*/
g_linux_wlan = kzalloc(sizeof(linux_wlan_t), GFP_KERNEL);
+ if (!g_linux_wlan)
+ return -ENOMEM;
/*Reset interrupt count debug*/
int_rcvdU = 0;
--
2.5.1
next prev parent reply other threads:[~2015-09-07 15:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 15:36 [PATCH 1/5] staging: wilc1000: linux_wlan.c: use kzalloc instead of WILC_MALLOC Chaehyun Lim
2015-09-07 15:36 ` Chaehyun Lim [this message]
2015-09-07 15:36 ` [PATCH 3/5] staging: wilc1000: remove commented codes Chaehyun Lim
2015-09-07 15:36 ` [PATCH 4/5] staging: wilc1000: wilc_msgqueue.c: use kmalloc with GFP_ATOMIC Chaehyun Lim
2015-09-08 2:23 ` Tony Cho
2015-09-08 4:48 ` Greg KH
2015-09-09 6:37 ` Sudip Mukherjee
2015-09-07 15:36 ` [PATCH 5/5] staging: wilc1000: host_interface.c: fix build warning Chaehyun Lim
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=1441640199-1507-2-git-send-email-chaehyun.lim@gmail.com \
--to=chaehyun.lim@gmail.com \
--cc=chris.park@atmel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=johnny.kim@atmel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=rachel.kim@atmel.com \
/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;
as well as URLs for NNTP newsgroup(s).