| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * O(1) TX queue with built-in allocator for ST-Ericsson CW1200 drivers |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2010, ST-Ericsson |
|---|
| 5 | 6 | * 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. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <net/mac80211.h> |
|---|
| .. | .. |
|---|
| 82 | 79 | struct cw1200_queue_item *item) |
|---|
| 83 | 80 | { |
|---|
| 84 | 81 | 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), |
|---|
| 86 | 83 | GFP_ATOMIC); |
|---|
| 87 | 84 | BUG_ON(!gc_item); |
|---|
| 88 | | - memcpy(gc_item, item, sizeof(struct cw1200_queue_item)); |
|---|
| 89 | 85 | list_add_tail(&gc_item->head, gc_list); |
|---|
| 90 | 86 | } |
|---|
| 91 | 87 | |
|---|
| .. | .. |
|---|
| 283 | 279 | struct cw1200_txpriv *txpriv) |
|---|
| 284 | 280 | { |
|---|
| 285 | 281 | int ret = 0; |
|---|
| 286 | | - LIST_HEAD(gc_list); |
|---|
| 287 | 282 | struct cw1200_queue_stats *stats = queue->stats; |
|---|
| 288 | 283 | |
|---|
| 289 | 284 | if (txpriv->link_id >= queue->stats->map_capacity) |
|---|