staging: wilc1000: fix mgmt_tx()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 10 Feb 2016 09:05:40 +0000 (12:05 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Feb 2016 03:31:50 +0000 (19:31 -0800)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index bf264d3657bec8d18d7f99403951e715c5c636dd..97d1b802a75e12613704d1ba66fb4974ca63f1bd 100644 (file)
@@ -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;