]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blobdiff - include/linux/skbuff.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
[mirror_ubuntu-kernels.git] / include / linux / skbuff.h
index 6d58fa8a65fde76c2b52c2a88e8b1974b87f304c..056f557d5194e21263557111c51f91b2bdf34fef 100644 (file)
@@ -1,14 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  *     Definitions for the 'struct sk_buff' memory handlers.
  *
  *     Authors:
  *             Alan Cox, <gw4pts@gw4pts.ampr.org>
  *             Florian La Roche, <rzsfl@rz.uni-sb.de>
- *
- *     This program is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License
- *     as published by the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
  */
 
 #ifndef _LINUX_SKBUFF_H
@@ -1434,10 +1430,12 @@ static inline void skb_zcopy_clear(struct sk_buff *skb, bool zerocopy)
        struct ubuf_info *uarg = skb_zcopy(skb);
 
        if (uarg) {
-               if (uarg->callback == sock_zerocopy_callback) {
+               if (skb_zcopy_is_nouarg(skb)) {
+                       /* no notification callback */
+               } else if (uarg->callback == sock_zerocopy_callback) {
                        uarg->zerocopy = uarg->zerocopy && zerocopy;
                        sock_zerocopy_put(uarg);
-               } else if (!skb_zcopy_is_nouarg(skb)) {
+               } else {
                        uarg->callback(uarg, zerocopy);
                }
 
@@ -2691,7 +2689,8 @@ static inline int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask)
 {
        if (likely(!skb_zcopy(skb)))
                return 0;
-       if (skb_uarg(skb)->callback == sock_zerocopy_callback)
+       if (!skb_zcopy_is_nouarg(skb) &&
+           skb_uarg(skb)->callback == sock_zerocopy_callback)
                return 0;
        return skb_copy_ubufs(skb, gfp_mask);
 }