Commit 3f155eba authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: use sizeof(variable) for memory allocated to store key info

Changes to fix below checkpatch reported issues.

CHECK: Prefer kmalloc(sizeof(*priv->wilc_gtk[idx])...) over
kmalloc(sizeof(struct wilc_wfi_key)...)

CHECK: Prefer kmalloc(sizeof(*priv->wilc_ptk[idx])...) over
kmalloc(sizeof(struct wilc_wfi_key)...)
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 35237fe4
...@@ -870,15 +870,15 @@ static inline void wilc_wfi_cfg_copy_wep_info(struct wilc_priv *priv, ...@@ -870,15 +870,15 @@ static inline void wilc_wfi_cfg_copy_wep_info(struct wilc_priv *priv,
static int wilc_wfi_cfg_allocate_wpa_entry(struct wilc_priv *priv, u8 idx) static int wilc_wfi_cfg_allocate_wpa_entry(struct wilc_priv *priv, u8 idx)
{ {
if (!priv->wilc_gtk[idx]) { if (!priv->wilc_gtk[idx]) {
priv->wilc_gtk[idx] = kzalloc(sizeof(struct wilc_wfi_key), priv->wilc_gtk[idx] = kzalloc(sizeof(*priv->wilc_gtk[idx]),
GFP_KERNEL); GFP_KERNEL);
if (!priv->wilc_gtk[idx]) if (!priv->wilc_gtk[idx])
return -ENOMEM; return -ENOMEM;
} }
if (!priv->wilc_ptk[idx]) { if (!priv->wilc_ptk[idx]) {
priv->wilc_ptk[idx] = kzalloc(sizeof(struct wilc_wfi_key), priv->wilc_ptk[idx] = kzalloc(sizeof(*priv->wilc_ptk[idx]),
GFP_KERNEL); GFP_KERNEL);
if (!priv->wilc_ptk[idx]) if (!priv->wilc_ptk[idx])
return -ENOMEM; return -ENOMEM;
} }
......
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