kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] staging: wilc1000: fix mgmt_tx()
@ 2016-02-10  9:05 Dan Carpenter
  2016-02-10  9:41 ` walter harms
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-02-10  9:05 UTC (permalink / raw)
  To: kernel-janitors

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@oracle.com>

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-10  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-10  9:05 [patch] staging: wilc1000: fix mgmt_tx() Dan Carpenter
2016-02-10  9:41 ` walter harms

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).