hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/net/xfrm/xfrm_ipcomp.c
....@@ -1,13 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * IP Payload Compression Protocol (IPComp) - RFC3173.
34 *
45 * Copyright (c) 2003 James Morris <jmorris@intercode.com.au>
56 * Copyright (c) 2003-2008 Herbert Xu <herbert@gondor.apana.org.au>
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms of the GNU General Public License as published by the Free
9
- * Software Foundation; either version 2 of the License, or (at your option)
10
- * any later version.
117 *
128 * Todo:
139 * - Tunable compression parameters.
....@@ -89,7 +85,7 @@
8985 if (dlen < len)
9086 len = dlen;
9187
92
- frag->page_offset = 0;
88
+ skb_frag_off_set(frag, 0);
9389 skb_frag_size_set(frag, len);
9490 memcpy(skb_frag_address(frag), scratch, len);
9591
....@@ -216,6 +212,7 @@
216212 vfree(*per_cpu_ptr(scratches, i));
217213
218214 free_percpu(scratches);
215
+ ipcomp_scratches = NULL;
219216 }
220217
221218 static void * __percpu *ipcomp_alloc_scratches(void)
....@@ -254,7 +251,7 @@
254251 break;
255252 }
256253
257
- WARN_ON(!pos);
254
+ WARN_ON(list_entry_is_head(pos, &ipcomp_tfms_list, list));
258255
259256 if (--pos->users)
260257 return;