Commit 04212268 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: fix viawget_wpa_param size

Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d77fb7f7
...@@ -1488,17 +1488,15 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, ...@@ -1488,17 +1488,15 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info,
size_t seq_len = 0; size_t seq_len = 0;
size_t key_len = 0; size_t key_len = 0;
u8 *buf; u8 *buf;
size_t blen;
u8 key_array[64]; u8 key_array[64];
int ret = 0; int ret = 0;
PRINT_K("SIOCSIWENCODEEXT...... \n"); PRINT_K("SIOCSIWENCODEEXT......\n");
blen = sizeof(*param); buf = kzalloc(sizeof(struct viawget_wpa_param), GFP_KERNEL);
buf = kmalloc((int)blen, (int)GFP_KERNEL);
if (buf == NULL) if (buf == NULL)
return -ENOMEM; return -ENOMEM;
memset(buf, 0, blen);
param = (struct viawget_wpa_param *)buf; param = (struct viawget_wpa_param *)buf;
// recover alg_name // recover alg_name
...@@ -1592,7 +1590,7 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, ...@@ -1592,7 +1590,7 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info,
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
error: error:
kfree(param); kfree(buf);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment