| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 3 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 4 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 5 | | - * (at your option) any later version. |
|---|
| 6 | 3 | * |
|---|
| 7 | 4 | * Copyright Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) |
|---|
| 8 | 5 | */ |
|---|
| .. | .. |
|---|
| 126 | 123 | unsigned char *dptr; |
|---|
| 127 | 124 | int len, timeout; |
|---|
| 128 | 125 | |
|---|
| 129 | | - len = NR_NETWORK_LEN + NR_TRANSPORT_LEN; |
|---|
| 126 | + len = NR_TRANSPORT_LEN; |
|---|
| 130 | 127 | |
|---|
| 131 | 128 | switch (frametype & 0x0F) { |
|---|
| 132 | 129 | case NR_CONNREQ: |
|---|
| .. | .. |
|---|
| 144 | 141 | return; |
|---|
| 145 | 142 | } |
|---|
| 146 | 143 | |
|---|
| 147 | | - if ((skb = alloc_skb(len, GFP_ATOMIC)) == NULL) |
|---|
| 144 | + skb = alloc_skb(NR_NETWORK_LEN + len, GFP_ATOMIC); |
|---|
| 145 | + if (!skb) |
|---|
| 148 | 146 | return; |
|---|
| 149 | 147 | |
|---|
| 150 | 148 | /* |
|---|
| .. | .. |
|---|
| 152 | 150 | */ |
|---|
| 153 | 151 | skb_reserve(skb, NR_NETWORK_LEN); |
|---|
| 154 | 152 | |
|---|
| 155 | | - dptr = skb_put(skb, skb_tailroom(skb)); |
|---|
| 153 | + dptr = skb_put(skb, len); |
|---|
| 156 | 154 | |
|---|
| 157 | 155 | switch (frametype & 0x0F) { |
|---|
| 158 | 156 | case NR_CONNREQ: |
|---|