aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/linux_mon.c
diff options
context:
space:
mode:
authorChaehyun Lim <chaehyun.lim@gmail.com>2016-02-01 21:26:46 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-03 15:34:29 -0800
commitb026f6e8d607f40f9fcdc0bc9966db4bde4a1129 (patch)
tree84c36509baada76575671eb94e84c3af32e9d240 /drivers/staging/wilc1000/linux_mon.c
parentstaging: wilc1000: linux_mon: fix coding style of kmalloc usage (diff)
downloadlinux-dev-b026f6e8d607f40f9fcdc0bc9966db4bde4a1129.tar.xz
linux-dev-b026f6e8d607f40f9fcdc0bc9966db4bde4a1129.zip
staging: wilc1000: linux_mon: fix error code of kmalloc
This patch fixes error codes as -ENOMEM instead of using -EFAULT if kmalloc is failed. Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/linux_mon.c')
-rw-r--r--drivers/staging/wilc1000/linux_mon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index a19755ebd72c..1443a238a520 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -166,14 +166,14 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC);
if (!mgmt_tx) {
PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
- return -EFAULT;
+ return -ENOMEM;
}
mgmt_tx->buff = kmalloc(len, GFP_ATOMIC);
if (!mgmt_tx->buff) {
PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
kfree(mgmt_tx);
- return -EFAULT;
+ return -ENOMEM;
}
mgmt_tx->size = len;