[patch] staging: wilc1000: fix mgmt_tx()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There was a missing curly brace so this function returns failure instead
of succeeding.

Fixes: 06fb9336acdc ('staging: wilc1000: wilc_wfi_cfgoperations.c: replaces PRINT_ER with netdev_err')
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index bf264d3..97d1b80 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1832,9 +1832,10 @@ static int mgmt_tx(struct wiphy *wiphy,
 			return -EFAULT;
 
 		mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL);
-		if (!mgmt_tx->buff)
+		if (!mgmt_tx->buff) {
 			kfree(mgmt_tx);
-			return -EFAULT;
+			return -ENOMEM;
+		}
 
 		memcpy(mgmt_tx->buff, buf, len);
 		mgmt_tx->size = len;
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux