From: Jimmy Li Date: Tue, 8 Apr 2014 13:35:02 +0000 (+0800) Subject: Staging: vt6655: iwctl.c: fix a sparse warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=30d991dd44ded3288c373246f9fd8eaee291584a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Staging: vt6655: iwctl.c: fix a sparse warning fix a sparse warning and do some clean up. iwctl.c:1846:35: expected restricted gfp_t [usertype] flags Signed-off-by: Jimmy Li Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c index ac3fc16704c1..a601c47a3803 100644 --- a/drivers/staging/vt6655/iwctl.c +++ b/drivers/staging/vt6655/iwctl.c @@ -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) {