hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/wireless/st/cw1200/queue.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * O(1) TX queue with built-in allocator for ST-Ericsson CW1200 drivers
34 *
45 * Copyright (c) 2010, ST-Ericsson
56 * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #include <net/mac80211.h>
....@@ -82,10 +79,9 @@
8279 struct cw1200_queue_item *item)
8380 {
8481 struct cw1200_queue_item *gc_item;
85
- gc_item = kmalloc(sizeof(struct cw1200_queue_item),
82
+ gc_item = kmemdup(item, sizeof(struct cw1200_queue_item),
8683 GFP_ATOMIC);
8784 BUG_ON(!gc_item);
88
- memcpy(gc_item, item, sizeof(struct cw1200_queue_item));
8985 list_add_tail(&gc_item->head, gc_list);
9086 }
9187
....@@ -283,7 +279,6 @@
283279 struct cw1200_txpriv *txpriv)
284280 {
285281 int ret = 0;
286
- LIST_HEAD(gc_list);
287282 struct cw1200_queue_stats *stats = queue->stats;
288283
289284 if (txpriv->link_id >= queue->stats->map_capacity)