]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/strparser/strparser.c
ipv6: use rt6_info members when dst is set in rt6_fill_node
[linux.git] / net / strparser / strparser.c
index 625acb27efcc272ccdc0f60d4d693d6761ed139b..da1a676860cad3c8a2a95acf11f0e908fe2bc255 100644 (file)
@@ -140,11 +140,13 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
                        /* We are going to append to the frags_list of head.
                         * Need to unshare the frag_list.
                         */
-                       err = skb_unclone(head, GFP_ATOMIC);
-                       if (err) {
-                               STRP_STATS_INCR(strp->stats.mem_fail);
-                               desc->error = err;
-                               return 0;
+                       if (skb_has_frag_list(head)) {
+                               err = skb_unclone(head, GFP_ATOMIC);
+                               if (err) {
+                                       STRP_STATS_INCR(strp->stats.mem_fail);
+                                       desc->error = err;
+                                       return 0;
+                               }
                        }
 
                        if (unlikely(skb_shinfo(head)->frag_list)) {
@@ -201,14 +203,16 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
                        memset(stm, 0, sizeof(*stm));
                        stm->strp.offset = orig_offset + eaten;
                } else {
-                       /* Unclone since we may be appending to an skb that we
+                       /* Unclone if we are appending to an skb that we
                         * already share a frag_list with.
                         */
-                       err = skb_unclone(skb, GFP_ATOMIC);
-                       if (err) {
-                               STRP_STATS_INCR(strp->stats.mem_fail);
-                               desc->error = err;
-                               break;
+                       if (skb_has_frag_list(skb)) {
+                               err = skb_unclone(skb, GFP_ATOMIC);
+                               if (err) {
+                                       STRP_STATS_INCR(strp->stats.mem_fail);
+                                       desc->error = err;
+                                       break;
+                               }
                        }
 
                        stm = _strp_msg(head);
@@ -404,8 +408,6 @@ EXPORT_SYMBOL_GPL(strp_data_ready);
 
 static void do_strp_work(struct strparser *strp)
 {
-       read_descriptor_t rd_desc;
-
        /* We need the read lock to synchronize with strp_data_ready. We
         * need the socket lock for calling strp_read_sock.
         */
@@ -417,8 +419,6 @@ static void do_strp_work(struct strparser *strp)
        if (strp->paused)
                goto out;
 
-       rd_desc.arg.data = strp;
-
        if (strp_read_sock(strp) == -ENOMEM)
                queue_work(strp_wq, &strp->work);