Commit 95e72fba authored by Tobin C. Harding's avatar Tobin C. Harding Committed by Greg Kroah-Hartman

staging: ks7010: clean memory allocation

Memory allocation code contains unneeded debug statements, failed
kmalloc() calls typically do not require a debug message. Introduction
of a local 'size' variable allows kmalloc() call to be marginally
cleaner, still uses magic numbers but these require a more substantial
fix. Moving the magic numbers onto a single line opens the way for
further refactoring.

Clean memory allocation code, remove debug statements.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8215fc60
...@@ -1135,12 +1135,9 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb) ...@@ -1135,12 +1135,9 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
netif_stop_queue(priv->net_dev); netif_stop_queue(priv->net_dev);
} }
DPRINTK(4, "skb_buff length=%d\n", skb_len); size = sizeof(*pp) + 6 + skb_len + 8;
pp = kmalloc(hif_align_size(sizeof(*pp) + 6 + skb_len + 8), pp = kmalloc(hif_align_size(size), KS_WLAN_MEM_FLAG);
KS_WLAN_MEM_FLAG);
if (!pp) { if (!pp) {
DPRINTK(3, "allocate memory failed..\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_kfree_skb; goto err_kfree_skb;
} }
......
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