Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df367561 authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Steffen Klassert
Browse files

net/xfrm: use kmemdup rather than duplicating its implementation

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: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent eae8dee9
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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])