staging: wilc1000: use kmalloc(sizeof(*mgmt_tx)...) in mgmt_tx()
authorAjay Singh <ajay.kathat@microchip.com>
Fri, 11 May 2018 08:13:12 +0000 (13:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 May 2018 12:04:48 +0000 (14:04 +0200)
Fix below checkpatch issue found in mgmt_tx()

Prefer kmalloc(sizeof(*mgmt_tx)...) over kmalloc(sizeof(struct
p2p_mgmt_data)...)

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index 65ba6edb86f432b06d61e3f8dcf72ec880dec500..1408ebde4196d733f3660c4e7f6b608659a5285b 100644 (file)
@@ -1622,7 +1622,7 @@ static int mgmt_tx(struct wiphy *wiphy,
        if (!ieee80211_is_mgmt(mgmt->frame_control))
                goto out;
 
-       mgmt_tx = kmalloc(sizeof(struct p2p_mgmt_data), GFP_KERNEL);
+       mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_KERNEL);
        if (!mgmt_tx) {
                ret = -ENOMEM;
                goto out;