| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * IP Payload Compression Protocol (IPComp) - RFC3173. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2003 James Morris <jmorris@intercode.com.au> |
|---|
| 5 | 6 | * 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. |
|---|
| 11 | 7 | * |
|---|
| 12 | 8 | * Todo: |
|---|
| 13 | 9 | * - Tunable compression parameters. |
|---|
| .. | .. |
|---|
| 89 | 85 | if (dlen < len) |
|---|
| 90 | 86 | len = dlen; |
|---|
| 91 | 87 | |
|---|
| 92 | | - frag->page_offset = 0; |
|---|
| 88 | + skb_frag_off_set(frag, 0); |
|---|
| 93 | 89 | skb_frag_size_set(frag, len); |
|---|
| 94 | 90 | memcpy(skb_frag_address(frag), scratch, len); |
|---|
| 95 | 91 | |
|---|
| .. | .. |
|---|
| 216 | 212 | vfree(*per_cpu_ptr(scratches, i)); |
|---|
| 217 | 213 | |
|---|
| 218 | 214 | free_percpu(scratches); |
|---|
| 215 | + ipcomp_scratches = NULL; |
|---|
| 219 | 216 | } |
|---|
| 220 | 217 | |
|---|
| 221 | 218 | static void * __percpu *ipcomp_alloc_scratches(void) |
|---|
| .. | .. |
|---|
| 254 | 251 | break; |
|---|
| 255 | 252 | } |
|---|
| 256 | 253 | |
|---|
| 257 | | - WARN_ON(!pos); |
|---|
| 254 | + WARN_ON(list_entry_is_head(pos, &ipcomp_tfms_list, list)); |
|---|
| 258 | 255 | |
|---|
| 259 | 256 | if (--pos->users) |
|---|
| 260 | 257 | return; |
|---|