diff for duplicates of <1161889418.7318.1.camel@alice> diff --git a/a/1.txt b/N1/1.txt index f731090..1289220 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -8,12 +8,12 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> --- linux-2.6.19-rc3-git1/net/atm/lec.c.orig 2006-10-26 20:21:48.000000000 +0200 +++ linux-2.6.19-rc3-git1/net/atm/lec.c 2006-10-26 20:23:28.000000000 +0200 @@ -1321,11 +1321,10 @@ static int lane2_resolve(struct net_devi - if (table = NULL) + if (table == NULL) return -1; - *tlvs = kmalloc(table->sizeoftlvs, GFP_ATOMIC); + *tlvs = kmemdup(table->tlvs, table->sizeoftlvs, GFP_ATOMIC); - if (*tlvs = NULL) + if (*tlvs == NULL) return -1; - memcpy(*tlvs, table->tlvs, table->sizeoftlvs); @@ -26,21 +26,21 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> - priv->tlvs = kmalloc(sizeoftlvs, GFP_KERNEL); + priv->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL); - if (priv->tlvs = NULL) + if (priv->tlvs == NULL) return (0); priv->sizeoftlvs = sizeoftlvs; - memcpy(priv->tlvs, tlvs, sizeoftlvs); skb = alloc_skb(sizeoftlvs, GFP_ATOMIC); - if (skb = NULL) + if (skb == NULL) --- linux-2.6.19-rc3-git1/net/ax25/ax25_out.c.orig 2006-10-26 20:23:59.000000000 +0200 +++ linux-2.6.19-rc3-git1/net/ax25/ax25_out.c 2006-10-26 20:24:15.000000000 +0200 @@ -70,11 +70,10 @@ ax25_cb *ax25_send_frame(struct sk_buff ax25->dest_addr = *dest; if (digi != NULL) { -- if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) = NULL) { -+ if ((ax25->digipeat = kmemdup(digi, sizeof(ax25_digi), GFP_ATOMIC)) = NULL) { +- if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { ++ if ((ax25->digipeat = kmemdup(digi, sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { ax25_cb_put(ax25); return NULL; } @@ -54,9 +54,9 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> } if (ax25_rt->digipeat != NULL) { -- if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) = NULL) { +- if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { + if ((ax25->digipeat = kmemdup(ax25_rt->digipeat, -+ sizeof(ax25_digi), GFP_ATOMIC)) = NULL) { ++ sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { err = -ENOMEM; goto put; } @@ -81,12 +81,12 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> --- linux-2.6.19-rc3-git1/net/dccp/feat.c.orig 2006-10-26 20:26:12.000000000 +0200 +++ linux-2.6.19-rc3-git1/net/dccp/feat.c 2006-10-26 20:27:26.000000000 +0200 @@ -279,12 +279,11 @@ static int dccp_feat_nn(struct sock *sk, - if (opt = NULL) + if (opt == NULL) return -ENOMEM; - copy = kmalloc(len, GFP_ATOMIC); + copy = kmemdup(val, len, GFP_ATOMIC); - if (copy = NULL) { + if (copy == NULL) { kfree(opt); return -ENOMEM; } @@ -101,13 +101,13 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> - u8 *val = kmalloc(opt->dccpop_len, GFP_ATOMIC); + u8 *val = kmemdup(opt->dccpop_val, opt->dccpop_len, GFP_ATOMIC); - if (val = NULL) + if (val == NULL) goto out_clean; - memcpy(val, opt->dccpop_val, opt->dccpop_len); - newopt = kmalloc(sizeof(*newopt), GFP_ATOMIC); + newopt = kmemdup(opt, sizeof(*newopt), GFP_ATOMIC); - if (newopt = NULL) { + if (newopt == NULL) { kfree(val); goto out_clean; } @@ -137,7 +137,7 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmemdup(&dn_dev_sysctl, sizeof(*t), GFP_KERNEL); - if (t = NULL) + if (t == NULL) return; - memcpy(t, &dn_dev_sysctl, sizeof(*t)); @@ -180,7 +180,7 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> - int *t; - - t = kmalloc(size, GFP_ATOMIC); -- if (t = NULL) +- if (t == NULL) - return NULL; - memcpy(t, table, size); - return t; @@ -192,11 +192,11 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> +++ linux-2.6.19-rc3-git1/net/ipv4/cipso_ipv4.c 2006-10-26 20:34:51.000000000 +0200 @@ -377,12 +377,11 @@ int cipso_v4_cache_add(const struct sk_b entry = kzalloc(sizeof(*entry), GFP_ATOMIC); - if (entry = NULL) + if (entry == NULL) return -ENOMEM; - entry->key = kmalloc(cipso_ptr_len, GFP_ATOMIC); + entry->key = kmemdup(cisco_ptr, cipso_ptr_len, GFP_ATOMIC); - if (entry->key = NULL) { + if (entry->key == NULL) { ret_val = -ENOMEM; goto cache_add_failure; } @@ -212,7 +212,7 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmemdup(&addrconf_sysctl, sizeof(*t), GFP_KERNEL); - if (t = NULL) + if (t == NULL) return; - memcpy(t, &addrconf_sysctl, sizeof(*t)); for (i=0; t->addrconf_vars[i].data; i++) { @@ -226,7 +226,7 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> - value->t.oct_seq = kmalloc(len, GFP_ATOMIC); + value->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC); - if (value->t.oct_seq = NULL){ + if (value->t.oct_seq == NULL){ IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); kfree(value); return NULL; @@ -241,9 +241,9 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> atomic_set(&nr_neigh->refcount, 1); if (ax25_digi != NULL && ax25_digi->ndigi > 0) { -- if ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) = NULL) { +- if ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) == NULL) { + if ((nr_neigh->digipeat = kmemdup(ax25_digi, -+ sizeof(*ax25_digi), GFP_KERNEL)) = NULL) { ++ sizeof(*ax25_digi), GFP_KERNEL)) == NULL) { kfree(nr_neigh); if (nr_node) nr_node_put(nr_node); @@ -258,9 +258,9 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> atomic_set(&nr_neigh->refcount, 1); if (ax25_digi != NULL && ax25_digi->ndigi > 0) { -- if ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) = NULL) { +- if ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) == NULL) { + if ((nr_neigh->digipeat = kmemdup(ax25_digi, -+ sizeof(*ax25_digi), GFP_KERNEL)) = NULL) { ++ sizeof(*ax25_digi), GFP_KERNEL)) == NULL) { kfree(nr_neigh); return -ENOMEM; } @@ -305,7 +305,7 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> } else { - void *v = kmalloc(data_len, GFP_KERNEL); + void *v = kmemdup(data, data_len, GFP_KERNEL); - if (v = NULL) { + if (v == NULL) { err = -ENOBUFS; goto errout; } @@ -335,7 +335,7 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> return ERR_PTR(-EFAULT); - dest->data = kmalloc(len, GFP_KERNEL); + dest->data = kmemdup(p, len, GFP_KERNEL); - if (unlikely(dest->data = NULL)) + if (unlikely(dest->data == NULL)) return ERR_PTR(-ENOMEM); dest->len = len; - memcpy(dest->data, p, len); @@ -350,7 +350,7 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> return ERR_PTR(-EFAULT); - res->data = kmalloc(len, GFP_KERNEL); + res->data = kmemdup(p, len, GFP_KERNEL); - if (unlikely(res->data = NULL)) + if (unlikely(res->data == NULL)) return ERR_PTR(-ENOMEM); - memcpy(res->data, p, len); res->len = len; @@ -364,7 +364,7 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> return ERR_PTR(-EFAULT); - res->data = kmalloc(len, GFP_KERNEL); + res->data = kmemdup(p, len, GFP_KERNEL); - if (unlikely(res->data = NULL)) + if (unlikely(res->data == NULL)) return ERR_PTR(-ENOMEM); - memcpy(res->data, p, len); return q; @@ -425,9 +425,3 @@ Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> *addrpp = p; return 0; } - - -_______________________________________________ -Kernel-janitors mailing list -Kernel-janitors@lists.osdl.org -https://lists.osdl.org/mailman/listinfo/kernel-janitors diff --git a/a/content_digest b/N1/content_digest index 6eec379..7de3a5f 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,6 +1,6 @@ "From\0Eric Sesterhenn <snakebyte@gmx.de>\0" - "Subject\0[KJ] [Patch] kmemdup() cleanup in net/\0" - "Date\0Thu, 26 Oct 2006 19:03:38 +0000\0" + "Subject\0[Patch] kmemdup() cleanup in net/\0" + "Date\0Thu, 26 Oct 2006 21:03:38 +0200\0" "To\0kernel-janitors <kernel-janitors@lists.osdl.org>\0" "Cc\0netdev@vger.kernel.org\0" "\00:1\0" @@ -15,12 +15,12 @@ "--- linux-2.6.19-rc3-git1/net/atm/lec.c.orig\t2006-10-26 20:21:48.000000000 +0200\n" "+++ linux-2.6.19-rc3-git1/net/atm/lec.c\t2006-10-26 20:23:28.000000000 +0200\n" "@@ -1321,11 +1321,10 @@ static int lane2_resolve(struct net_devi\n" - " \t\tif (table = NULL)\n" + " \t\tif (table == NULL)\n" " \t\t\treturn -1;\n" " \n" "-\t\t*tlvs = kmalloc(table->sizeoftlvs, GFP_ATOMIC);\n" "+\t\t*tlvs = kmemdup(table->tlvs, table->sizeoftlvs, GFP_ATOMIC);\n" - " \t\tif (*tlvs = NULL)\n" + " \t\tif (*tlvs == NULL)\n" " \t\t\treturn -1;\n" " \n" "-\t\tmemcpy(*tlvs, table->tlvs, table->sizeoftlvs);\n" @@ -33,21 +33,21 @@ " \n" "-\tpriv->tlvs = kmalloc(sizeoftlvs, GFP_KERNEL);\n" "+\tpriv->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL);\n" - " \tif (priv->tlvs = NULL)\n" + " \tif (priv->tlvs == NULL)\n" " \t\treturn (0);\n" " \tpriv->sizeoftlvs = sizeoftlvs;\n" "-\tmemcpy(priv->tlvs, tlvs, sizeoftlvs);\n" " \n" " \tskb = alloc_skb(sizeoftlvs, GFP_ATOMIC);\n" - " \tif (skb = NULL)\n" + " \tif (skb == NULL)\n" "--- linux-2.6.19-rc3-git1/net/ax25/ax25_out.c.orig\t2006-10-26 20:23:59.000000000 +0200\n" "+++ linux-2.6.19-rc3-git1/net/ax25/ax25_out.c\t2006-10-26 20:24:15.000000000 +0200\n" "@@ -70,11 +70,10 @@ ax25_cb *ax25_send_frame(struct sk_buff \n" " \tax25->dest_addr = *dest;\n" " \n" " \tif (digi != NULL) {\n" - "-\t\tif ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) = NULL) {\n" - "+\t\tif ((ax25->digipeat = kmemdup(digi, sizeof(ax25_digi), GFP_ATOMIC)) = NULL) {\n" + "-\t\tif ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {\n" + "+\t\tif ((ax25->digipeat = kmemdup(digi, sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {\n" " \t\t\tax25_cb_put(ax25);\n" " \t\t\treturn NULL;\n" " \t\t}\n" @@ -61,9 +61,9 @@ " \t}\n" " \n" " \tif (ax25_rt->digipeat != NULL) {\n" - "-\t\tif ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) = NULL) {\n" + "-\t\tif ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {\n" "+\t\tif ((ax25->digipeat = kmemdup(ax25_rt->digipeat, \n" - "+\t\t\tsizeof(ax25_digi), GFP_ATOMIC)) = NULL) {\n" + "+\t\t\tsizeof(ax25_digi), GFP_ATOMIC)) == NULL) {\n" " \t\t\terr = -ENOMEM;\n" " \t\t\tgoto put;\n" " \t\t}\n" @@ -88,12 +88,12 @@ "--- linux-2.6.19-rc3-git1/net/dccp/feat.c.orig\t2006-10-26 20:26:12.000000000 +0200\n" "+++ linux-2.6.19-rc3-git1/net/dccp/feat.c\t2006-10-26 20:27:26.000000000 +0200\n" "@@ -279,12 +279,11 @@ static int dccp_feat_nn(struct sock *sk,\n" - " \tif (opt = NULL)\n" + " \tif (opt == NULL)\n" " \t\treturn -ENOMEM;\n" " \n" "-\tcopy = kmalloc(len, GFP_ATOMIC);\n" "+\tcopy = kmemdup(val, len, GFP_ATOMIC);\n" - " \tif (copy = NULL) {\n" + " \tif (copy == NULL) {\n" " \t\tkfree(opt);\n" " \t\treturn -ENOMEM;\n" " \t}\n" @@ -108,13 +108,13 @@ "-\t\tu8 *val = kmalloc(opt->dccpop_len, GFP_ATOMIC);\n" "+\t\tu8 *val = kmemdup(opt->dccpop_val, opt->dccpop_len, GFP_ATOMIC);\n" " \n" - " \t\tif (val = NULL)\n" + " \t\tif (val == NULL)\n" " \t\t\tgoto out_clean;\n" "-\t\tmemcpy(val, opt->dccpop_val, opt->dccpop_len);\n" " \n" "-\t\tnewopt = kmalloc(sizeof(*newopt), GFP_ATOMIC);\n" "+\t\tnewopt = kmemdup(opt, sizeof(*newopt), GFP_ATOMIC);\n" - " \t\tif (newopt = NULL) {\n" + " \t\tif (newopt == NULL) {\n" " \t\t\tkfree(val);\n" " \t\t\tgoto out_clean;\n" " \t\t}\n" @@ -144,7 +144,7 @@ " \n" "-\tt = kmalloc(sizeof(*t), GFP_KERNEL);\n" "+\tt = kmemdup(&dn_dev_sysctl, sizeof(*t), GFP_KERNEL);\n" - " \tif (t = NULL)\n" + " \tif (t == NULL)\n" " \t\treturn;\n" " \n" "-\tmemcpy(t, &dn_dev_sysctl, sizeof(*t));\n" @@ -187,7 +187,7 @@ "-\tint *t;\n" "-\n" "-\tt = kmalloc(size, GFP_ATOMIC);\n" - "-\tif (t = NULL)\n" + "-\tif (t == NULL)\n" "-\t\treturn NULL;\n" "-\tmemcpy(t, table, size);\n" "-\treturn t;\n" @@ -199,11 +199,11 @@ "+++ linux-2.6.19-rc3-git1/net/ipv4/cipso_ipv4.c\t2006-10-26 20:34:51.000000000 +0200\n" "@@ -377,12 +377,11 @@ int cipso_v4_cache_add(const struct sk_b\n" " \tentry = kzalloc(sizeof(*entry), GFP_ATOMIC);\n" - " \tif (entry = NULL)\n" + " \tif (entry == NULL)\n" " \t\treturn -ENOMEM;\n" "-\tentry->key = kmalloc(cipso_ptr_len, GFP_ATOMIC);\n" "+\tentry->key = kmemdup(cisco_ptr, cipso_ptr_len, GFP_ATOMIC);\n" - " \tif (entry->key = NULL) {\n" + " \tif (entry->key == NULL) {\n" " \t\tret_val = -ENOMEM;\n" " \t\tgoto cache_add_failure;\n" " \t}\n" @@ -219,7 +219,7 @@ " \n" "-\tt = kmalloc(sizeof(*t), GFP_KERNEL);\n" "+\tt = kmemdup(&addrconf_sysctl, sizeof(*t), GFP_KERNEL);\n" - " \tif (t = NULL)\n" + " \tif (t == NULL)\n" " \t\treturn;\n" "-\tmemcpy(t, &addrconf_sysctl, sizeof(*t));\n" " \tfor (i=0; t->addrconf_vars[i].data; i++) {\n" @@ -233,7 +233,7 @@ " \n" "-\tvalue->t.oct_seq = kmalloc(len, GFP_ATOMIC);\n" "+\tvalue->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC);\n" - " \tif (value->t.oct_seq = NULL){\n" + " \tif (value->t.oct_seq == NULL){\n" " \t\tIRDA_WARNING(\"%s: Unable to kmalloc!\\n\", __FUNCTION__);\n" " \t\tkfree(value);\n" " \t\treturn NULL;\n" @@ -248,9 +248,9 @@ " \t\tatomic_set(&nr_neigh->refcount, 1);\n" " \n" " \t\tif (ax25_digi != NULL && ax25_digi->ndigi > 0) {\n" - "-\t\t\tif ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) = NULL) {\n" + "-\t\t\tif ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) == NULL) {\n" "+\t\t\tif ((nr_neigh->digipeat = kmemdup(ax25_digi, \n" - "+\t\t\t\tsizeof(*ax25_digi), GFP_KERNEL)) = NULL) {\n" + "+\t\t\t\tsizeof(*ax25_digi), GFP_KERNEL)) == NULL) {\n" " \t\t\t\tkfree(nr_neigh);\n" " \t\t\t\tif (nr_node)\n" " \t\t\t\t\tnr_node_put(nr_node);\n" @@ -265,9 +265,9 @@ " \tatomic_set(&nr_neigh->refcount, 1);\n" " \n" " \tif (ax25_digi != NULL && ax25_digi->ndigi > 0) {\n" - "-\t\tif ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) = NULL) {\n" + "-\t\tif ((nr_neigh->digipeat = kmalloc(sizeof(*ax25_digi), GFP_KERNEL)) == NULL) {\n" "+\t\tif ((nr_neigh->digipeat = kmemdup(ax25_digi,\n" - "+\t\t\tsizeof(*ax25_digi), GFP_KERNEL)) = NULL) {\n" + "+\t\t\tsizeof(*ax25_digi), GFP_KERNEL)) == NULL) {\n" " \t\t\tkfree(nr_neigh);\n" " \t\t\treturn -ENOMEM;\n" " \t\t}\n" @@ -312,7 +312,7 @@ " \t\t\t} else {\n" "-\t\t\t\tvoid *v = kmalloc(data_len, GFP_KERNEL);\n" "+\t\t\t\tvoid *v = kmemdup(data, data_len, GFP_KERNEL);\n" - " \t\t\t\tif (v = NULL) {\n" + " \t\t\t\tif (v == NULL) {\n" " \t\t\t\t\terr = -ENOBUFS;\n" " \t\t\t\t\tgoto errout;\n" " \t\t\t\t}\n" @@ -342,7 +342,7 @@ " \t\treturn ERR_PTR(-EFAULT);\n" "-\tdest->data = kmalloc(len, GFP_KERNEL);\n" "+\tdest->data = kmemdup(p, len, GFP_KERNEL);\n" - " \tif (unlikely(dest->data = NULL))\n" + " \tif (unlikely(dest->data == NULL))\n" " \t\treturn ERR_PTR(-ENOMEM);\n" " \tdest->len = len;\n" "-\tmemcpy(dest->data, p, len);\n" @@ -357,7 +357,7 @@ " \t\treturn ERR_PTR(-EFAULT);\n" "-\tres->data = kmalloc(len, GFP_KERNEL);\n" "+\tres->data = kmemdup(p, len, GFP_KERNEL);\n" - " \tif (unlikely(res->data = NULL))\n" + " \tif (unlikely(res->data == NULL))\n" " \t\treturn ERR_PTR(-ENOMEM);\n" "-\tmemcpy(res->data, p, len);\n" " \tres->len = len;\n" @@ -371,7 +371,7 @@ " \t\treturn ERR_PTR(-EFAULT);\n" "-\tres->data = kmalloc(len, GFP_KERNEL);\n" "+\tres->data = kmemdup(p, len, GFP_KERNEL);\n" - " \tif (unlikely(res->data = NULL))\n" + " \tif (unlikely(res->data == NULL))\n" " \t\treturn ERR_PTR(-ENOMEM);\n" "-\tmemcpy(res->data, p, len);\n" " \treturn q;\n" @@ -431,12 +431,6 @@ "-\tmemcpy(p, uaddrp, sizeof(*p));\n" " \t*addrpp = p;\n" " \treturn 0;\n" - " }\n" - "\n" - "\n" - "_______________________________________________\n" - "Kernel-janitors mailing list\n" - "Kernel-janitors@lists.osdl.org\n" - https://lists.osdl.org/mailman/listinfo/kernel-janitors + } -10b68641a321f49fb154ba5538f781db7ae2e3639121f78155e8805a880677e2 +a69530476f5ba5e1422494fa5ccc7f064976d2121bac1d3c6568a566474db67e
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.