hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/netrom/nr_subr.c
....@@ -1,8 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
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.
63 *
74 * Copyright Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
85 */
....@@ -126,7 +123,7 @@
126123 unsigned char *dptr;
127124 int len, timeout;
128125
129
- len = NR_NETWORK_LEN + NR_TRANSPORT_LEN;
126
+ len = NR_TRANSPORT_LEN;
130127
131128 switch (frametype & 0x0F) {
132129 case NR_CONNREQ:
....@@ -144,7 +141,8 @@
144141 return;
145142 }
146143
147
- if ((skb = alloc_skb(len, GFP_ATOMIC)) == NULL)
144
+ skb = alloc_skb(NR_NETWORK_LEN + len, GFP_ATOMIC);
145
+ if (!skb)
148146 return;
149147
150148 /*
....@@ -152,7 +150,7 @@
152150 */
153151 skb_reserve(skb, NR_NETWORK_LEN);
154152
155
- dptr = skb_put(skb, skb_tailroom(skb));
153
+ dptr = skb_put(skb, len);
156154
157155 switch (frametype & 0x0F) {
158156 case NR_CONNREQ: