summaryrefslogtreecommitdiff
path: root/drivers/staging/ks7010
diff options
context:
space:
mode:
authorTobin C. Harding <me@tobin.cc>2017-04-27 11:25:17 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-28 11:45:49 +0200
commit95e72fba95fd1d9b9ef3ab080aafe1076f42a10a (patch)
treecb15d61007b30da14677c5107153f2c7cb8fd120 /drivers/staging/ks7010
parent8215fc607f50c516ceeb47fac046c3e4ea7acc4e (diff)
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: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ks7010')
-rw-r--r--drivers/staging/ks7010/ks_hostif.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 8755bd93ac37..7e9855f45a78 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1135,12 +1135,9 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
netif_stop_queue(priv->net_dev);
}
- DPRINTK(4, "skb_buff length=%d\n", skb_len);
- pp = kmalloc(hif_align_size(sizeof(*pp) + 6 + skb_len + 8),
- KS_WLAN_MEM_FLAG);
-
+ size = sizeof(*pp) + 6 + skb_len + 8;
+ pp = kmalloc(hif_align_size(size), KS_WLAN_MEM_FLAG);
if (!pp) {
- DPRINTK(3, "allocate memory failed..\n");
ret = -ENOMEM;
goto err_kfree_skb;
}