* [PATCH 16/31] net/cavium/liquidio: use kmemdup rather than duplicating its implementation
[not found] <1438934377-4922-1-git-send-email-a.hajda@samsung.com>
@ 2015-08-07 7:59 ` Andrzej Hajda
2015-09-16 10:02 ` Andrzej Hajda
2015-08-07 7:59 ` [PATCH 26/31] net/sched: " Andrzej Hajda
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Andrzej Hajda @ 2015-08-07 7:59 UTC (permalink / raw)
To: Derek Chickles, Satanand Burla, Felix Manlunas, Raghu Vatsavayi,
Sunil Goutham, Robert Richter
Cc: Bartlomiej Zolnierkiewicz, netdev, linux-kernel, Andrzej Hajda,
linux-arm-kernel, Marek Szyprowski
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
---
drivers/net/ethernet/cavium/liquidio/octeon_device.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.c b/drivers/net/ethernet/cavium/liquidio/octeon_device.c
index f67641a..8e23e3f 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_device.c
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.c
@@ -602,12 +602,10 @@ int octeon_download_firmware(struct octeon_device *oct, const u8 *data,
snprintf(oct->fw_info.liquidio_firmware_version, 32, "LIQUIDIO: %s",
h->version);
- buffer = kmalloc(size, GFP_KERNEL);
+ buffer = kmemdup(data, size, GFP_KERNEL);
if (!buffer)
return -ENOMEM;
- memcpy(buffer, data, size);
-
p = buffer + sizeof(struct octeon_firmware_file_header);
/* load all images */
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 26/31] net/sched: use kmemdup rather than duplicating its implementation
[not found] <1438934377-4922-1-git-send-email-a.hajda@samsung.com>
2015-08-07 7:59 ` [PATCH 16/31] net/cavium/liquidio: use kmemdup rather than duplicating its implementation Andrzej Hajda
@ 2015-08-07 7:59 ` Andrzej Hajda
2015-08-07 10:35 ` Daniel Borkmann
2015-08-07 7:59 ` [PATCH 27/31] net/tipc: " Andrzej Hajda
2015-08-07 7:59 ` [PATCH 28/31] net/xfrm: " Andrzej Hajda
3 siblings, 1 reply; 10+ messages in thread
From: Andrzej Hajda @ 2015-08-07 7:59 UTC (permalink / raw)
To: Jamal Hadi Salim, David S. Miller
Cc: Andrzej Hajda, Bartlomiej Zolnierkiewicz, Marek Szyprowski,
linux-kernel, netdev
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
---
net/sched/act_bpf.c | 4 +---
net/sched/cls_bpf.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c
index 1b97dab..5c0fa03 100644
--- a/net/sched/act_bpf.c
+++ b/net/sched/act_bpf.c
@@ -190,12 +190,10 @@ static int tcf_bpf_init_from_ops(struct nlattr **tb, struct tcf_bpf_cfg *cfg)
if (bpf_size != nla_len(tb[TCA_ACT_BPF_OPS]))
return -EINVAL;
- bpf_ops = kzalloc(bpf_size, GFP_KERNEL);
+ bpf_ops = kmemdup(nla_data(tb[TCA_ACT_BPF_OPS]), bpf_size, GFP_KERNEL);
if (bpf_ops == NULL)
return -ENOMEM;
- memcpy(bpf_ops, nla_data(tb[TCA_ACT_BPF_OPS]), bpf_size);
-
fprog_tmp.len = bpf_num_ops;
fprog_tmp.filter = bpf_ops;
diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c
index e5168f8..423f774 100644
--- a/net/sched/cls_bpf.c
+++ b/net/sched/cls_bpf.c
@@ -212,12 +212,10 @@ static int cls_bpf_prog_from_ops(struct nlattr **tb,
if (bpf_size != nla_len(tb[TCA_BPF_OPS]))
return -EINVAL;
- bpf_ops = kzalloc(bpf_size, GFP_KERNEL);
+ bpf_ops = kmemdup(nla_data(tb[TCA_BPF_OPS]), bpf_size, GFP_KERNEL);
if (bpf_ops == NULL)
return -ENOMEM;
- memcpy(bpf_ops, nla_data(tb[TCA_BPF_OPS]), bpf_size);
-
fprog_tmp.len = bpf_num_ops;
fprog_tmp.filter = bpf_ops;
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 27/31] net/tipc: use kmemdup rather than duplicating its implementation
[not found] <1438934377-4922-1-git-send-email-a.hajda@samsung.com>
2015-08-07 7:59 ` [PATCH 16/31] net/cavium/liquidio: use kmemdup rather than duplicating its implementation Andrzej Hajda
2015-08-07 7:59 ` [PATCH 26/31] net/sched: " Andrzej Hajda
@ 2015-08-07 7:59 ` Andrzej Hajda
2015-09-16 10:07 ` Andrzej Hajda
2015-09-17 1:19 ` Ying Xue
2015-08-07 7:59 ` [PATCH 28/31] net/xfrm: " Andrzej Hajda
3 siblings, 2 replies; 10+ messages in thread
From: Andrzej Hajda @ 2015-08-07 7:59 UTC (permalink / raw)
To: Jon Maloy, Ying Xue
Cc: Andrzej Hajda, Bartlomiej Zolnierkiewicz, Marek Szyprowski,
linux-kernel, David S. Miller, netdev
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
---
net/tipc/server.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/tipc/server.c b/net/tipc/server.c
index 922e04a..c187cad 100644
--- a/net/tipc/server.c
+++ b/net/tipc/server.c
@@ -411,13 +411,12 @@ static struct outqueue_entry *tipc_alloc_entry(void *data, int len)
if (!entry)
return NULL;
- buf = kmalloc(len, GFP_ATOMIC);
+ buf = kmemdup(data, len, GFP_ATOMIC);
if (!buf) {
kfree(entry);
return NULL;
}
- memcpy(buf, data, len);
entry->iov.iov_base = buf;
entry->iov.iov_len = len;
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 28/31] net/xfrm: use kmemdup rather than duplicating its implementation
[not found] <1438934377-4922-1-git-send-email-a.hajda@samsung.com>
` (2 preceding siblings ...)
2015-08-07 7:59 ` [PATCH 27/31] net/tipc: " Andrzej Hajda
@ 2015-08-07 7:59 ` Andrzej Hajda
2015-08-12 10:25 ` Steffen Klassert
3 siblings, 1 reply; 10+ messages in thread
From: Andrzej Hajda @ 2015-08-07 7:59 UTC (permalink / raw)
To: Steffen Klassert, Herbert Xu, David S. Miller
Cc: Andrzej Hajda, Bartlomiej Zolnierkiewicz, Marek Szyprowski,
linux-kernel, netdev
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
---
net/xfrm/xfrm_user.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 0cebf1f..a8de9e3 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -925,12 +925,10 @@ static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb)
return err;
if (attrs[XFRMA_ADDRESS_FILTER]) {
- filter = kmalloc(sizeof(*filter), GFP_KERNEL);
+ filter = kmemdup(nla_data(attrs[XFRMA_ADDRESS_FILTER]),
+ sizeof(*filter), GFP_KERNEL);
if (filter == NULL)
return -ENOMEM;
-
- memcpy(filter, nla_data(attrs[XFRMA_ADDRESS_FILTER]),
- sizeof(*filter));
}
if (attrs[XFRMA_PROTO])
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 26/31] net/sched: use kmemdup rather than duplicating its implementation
2015-08-07 7:59 ` [PATCH 26/31] net/sched: " Andrzej Hajda
@ 2015-08-07 10:35 ` Daniel Borkmann
0 siblings, 0 replies; 10+ messages in thread
From: Daniel Borkmann @ 2015-08-07 10:35 UTC (permalink / raw)
To: Andrzej Hajda, Jamal Hadi Salim, David S. Miller
Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski, linux-kernel, netdev
On 08/07/2015 09:59 AM, Andrzej Hajda wrote:
> The patch was generated using fixed coccinelle semantic patch
> scripts/coccinelle/api/memdup.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
Acked-by: Daniel Borkmann <daniel@iogearbox•net>
Not sure where the rest of this series went, but if you want this patch
to be routed via net-next tree (which I recommend, to avoid cross tree
conflicts), then you would need to send these patches separately, rebased
to that tree, and also mention [PATCH net-next XX/YY] in the subject.
^^^^^^^^
Thanks,
Daniel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 28/31] net/xfrm: use kmemdup rather than duplicating its implementation
2015-08-07 7:59 ` [PATCH 28/31] net/xfrm: " Andrzej Hajda
@ 2015-08-12 10:25 ` Steffen Klassert
0 siblings, 0 replies; 10+ messages in thread
From: Steffen Klassert @ 2015-08-12 10:25 UTC (permalink / raw)
To: Andrzej Hajda
Cc: Herbert Xu, David S. Miller, Bartlomiej Zolnierkiewicz,
Marek Szyprowski, linux-kernel, netdev
On Fri, Aug 07, 2015 at 09:59:34AM +0200, Andrzej Hajda wrote:
> The patch was generated using fixed coccinelle semantic patch
> scripts/coccinelle/api/memdup.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
Applied to ipsec-next, thanks!
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 16/31] net/cavium/liquidio: use kmemdup rather than duplicating its implementation
2015-08-07 7:59 ` [PATCH 16/31] net/cavium/liquidio: use kmemdup rather than duplicating its implementation Andrzej Hajda
@ 2015-09-16 10:02 ` Andrzej Hajda
0 siblings, 0 replies; 10+ messages in thread
From: Andrzej Hajda @ 2015-09-16 10:02 UTC (permalink / raw)
To: Derek Chickles, Satanand Burla, Felix Manlunas, Raghu Vatsavayi,
Sunil Goutham, Robert Richter
Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski, linux-kernel, netdev,
linux-arm-kernel
Ping.
Regards
Andrzej
On 08/07/2015 09:59 AM, Andrzej Hajda wrote:
> The patch was generated using fixed coccinelle semantic patch
> scripts/coccinelle/api/memdup.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
> ---
> drivers/net/ethernet/cavium/liquidio/octeon_device.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.c b/drivers/net/ethernet/cavium/liquidio/octeon_device.c
> index f67641a..8e23e3f 100644
> --- a/drivers/net/ethernet/cavium/liquidio/octeon_device.c
> +++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.c
> @@ -602,12 +602,10 @@ int octeon_download_firmware(struct octeon_device *oct, const u8 *data,
> snprintf(oct->fw_info.liquidio_firmware_version, 32, "LIQUIDIO: %s",
> h->version);
>
> - buffer = kmalloc(size, GFP_KERNEL);
> + buffer = kmemdup(data, size, GFP_KERNEL);
> if (!buffer)
> return -ENOMEM;
>
> - memcpy(buffer, data, size);
> -
> p = buffer + sizeof(struct octeon_firmware_file_header);
>
> /* load all images */
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 27/31] net/tipc: use kmemdup rather than duplicating its implementation
2015-08-07 7:59 ` [PATCH 27/31] net/tipc: " Andrzej Hajda
@ 2015-09-16 10:07 ` Andrzej Hajda
2015-09-17 9:58 ` Jon Maloy
2015-09-17 1:19 ` Ying Xue
1 sibling, 1 reply; 10+ messages in thread
From: Andrzej Hajda @ 2015-09-16 10:07 UTC (permalink / raw)
To: Jon Maloy, Ying Xue
Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski, linux-kernel,
David S. Miller, netdev
Ping.
Regards
Andrzej
On 08/07/2015 09:59 AM, Andrzej Hajda wrote:
> The patch was generated using fixed coccinelle semantic patch
> scripts/coccinelle/api/memdup.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
> ---
> net/tipc/server.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/tipc/server.c b/net/tipc/server.c
> index 922e04a..c187cad 100644
> --- a/net/tipc/server.c
> +++ b/net/tipc/server.c
> @@ -411,13 +411,12 @@ static struct outqueue_entry *tipc_alloc_entry(void *data, int len)
> if (!entry)
> return NULL;
>
> - buf = kmalloc(len, GFP_ATOMIC);
> + buf = kmemdup(data, len, GFP_ATOMIC);
> if (!buf) {
> kfree(entry);
> return NULL;
> }
>
> - memcpy(buf, data, len);
> entry->iov.iov_base = buf;
> entry->iov.iov_len = len;
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 27/31] net/tipc: use kmemdup rather than duplicating its implementation
2015-08-07 7:59 ` [PATCH 27/31] net/tipc: " Andrzej Hajda
2015-09-16 10:07 ` Andrzej Hajda
@ 2015-09-17 1:19 ` Ying Xue
1 sibling, 0 replies; 10+ messages in thread
From: Ying Xue @ 2015-09-17 1:19 UTC (permalink / raw)
To: Andrzej Hajda, Jon Maloy
Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski, linux-kernel,
David S. Miller, netdev
On 08/07/2015 03:59 PM, Andrzej Hajda wrote:
> The patch was generated using fixed coccinelle semantic patch
> scripts/coccinelle/api/memdup.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
Reviewed-by: Ying Xue <ying.xue@windriver•com>
> ---
> net/tipc/server.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/tipc/server.c b/net/tipc/server.c
> index 922e04a..c187cad 100644
> --- a/net/tipc/server.c
> +++ b/net/tipc/server.c
> @@ -411,13 +411,12 @@ static struct outqueue_entry *tipc_alloc_entry(void *data, int len)
> if (!entry)
> return NULL;
>
> - buf = kmalloc(len, GFP_ATOMIC);
> + buf = kmemdup(data, len, GFP_ATOMIC);
> if (!buf) {
> kfree(entry);
> return NULL;
> }
>
> - memcpy(buf, data, len);
> entry->iov.iov_base = buf;
> entry->iov.iov_len = len;
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH 27/31] net/tipc: use kmemdup rather than duplicating its implementation
2015-09-16 10:07 ` Andrzej Hajda
@ 2015-09-17 9:58 ` Jon Maloy
0 siblings, 0 replies; 10+ messages in thread
From: Jon Maloy @ 2015-09-17 9:58 UTC (permalink / raw)
To: Andrzej Hajda, Ying Xue
Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski,
linux-kernel@vger•kernel.org, David S. Miller,
netdev@vger•kernel.org
Acked-by: Jon Maloy <jon.maloy@ericsson•com>
///jon
> -----Original Message-----
> From: Andrzej Hajda [mailto:a.hajda@samsung•com]
> Sent: Wednesday, 16 September, 2015 06:07
> To: Jon Maloy; Ying Xue
> Cc: Bartlomiej Zolnierkiewicz; Marek Szyprowski; linux-
> kernel@vger•kernel.org; David S. Miller; netdev@vger•kernel.org
> Subject: Re: [PATCH 27/31] net/tipc: use kmemdup rather than duplicating its
> implementation
>
> Ping.
>
> Regards
> Andrzej
>
> On 08/07/2015 09:59 AM, Andrzej Hajda wrote:
> > The patch was generated using fixed coccinelle semantic patch
> > scripts/coccinelle/api/memdup.cocci [1].
> >
> > [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
> >
> > Signed-off-by: Andrzej Hajda <a.hajda@samsung•com>
> > ---
> > net/tipc/server.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/net/tipc/server.c b/net/tipc/server.c index
> > 922e04a..c187cad 100644
> > --- a/net/tipc/server.c
> > +++ b/net/tipc/server.c
> > @@ -411,13 +411,12 @@ static struct outqueue_entry
> *tipc_alloc_entry(void *data, int len)
> > if (!entry)
> > return NULL;
> >
> > - buf = kmalloc(len, GFP_ATOMIC);
> > + buf = kmemdup(data, len, GFP_ATOMIC);
> > if (!buf) {
> > kfree(entry);
> > return NULL;
> > }
> >
> > - memcpy(buf, data, len);
> > entry->iov.iov_base = buf;
> > entry->iov.iov_len = len;
> >
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-09-17 9:58 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1438934377-4922-1-git-send-email-a.hajda@samsung.com>
2015-08-07 7:59 ` [PATCH 16/31] net/cavium/liquidio: use kmemdup rather than duplicating its implementation Andrzej Hajda
2015-09-16 10:02 ` Andrzej Hajda
2015-08-07 7:59 ` [PATCH 26/31] net/sched: " Andrzej Hajda
2015-08-07 10:35 ` Daniel Borkmann
2015-08-07 7:59 ` [PATCH 27/31] net/tipc: " Andrzej Hajda
2015-09-16 10:07 ` Andrzej Hajda
2015-09-17 9:58 ` Jon Maloy
2015-09-17 1:19 ` Ying Xue
2015-08-07 7:59 ` [PATCH 28/31] net/xfrm: " Andrzej Hajda
2015-08-12 10:25 ` Steffen Klassert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox