Staging: vt6655: iwctl.c: fix a sparse warning
authorJimmy Li <coder.liss@gmail.com>
Tue, 8 Apr 2014 13:35:02 +0000 (21:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Apr 2014 23:10:29 +0000 (16:10 -0700)
fix a sparse warning and do some clean up.
iwctl.c:1846:35: expected restricted gfp_t [usertype] flags

Signed-off-by: Jimmy Li <coder.liss@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/iwctl.c

index ac3fc16704c1c5b54a50a9ca954bbfc58070a6d4..a601c47a3803cb5f9d67c510619ae8c1b21bee8e 100644 (file)
@@ -1835,19 +1835,14 @@ int iwctl_siwencodeext(struct net_device *dev,
        size_t seq_len = 0, key_len = 0;
 //
        // int ii;
-       u8 *buf;
-       size_t blen;
        u8 key_array[64];
        int ret = 0;
 
        PRINT_K("SIOCSIWENCODEEXT...... \n");
 
-       blen = sizeof(*param);
-       buf = kmalloc((int)blen, (int)GFP_KERNEL);
-       if (buf == NULL)
+       param = kzalloc(sizeof(*param), GFP_KERNEL);
+       if (param == NULL)
                return -ENOMEM;
-       memset(buf, 0, blen);
-       param = (struct viawget_wpa_param *)buf;
 
 //recover alg_name
        switch (ext->alg) {