All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] backports: add backport for nla_memdup()
@ 2016-11-12 20:18 Arend van Spriel
  2016-11-12 20:18 ` [PATCH 2/3] backports: add backport for genl_family_attrbuf() function Arend van Spriel
  2016-11-12 20:18 ` [PATCH 3/3] backports: empty define for __ro_after_init Arend van Spriel
  0 siblings, 2 replies; 6+ messages in thread
From: Arend van Spriel @ 2016-11-12 20:18 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports, Arend van Spriel

New helper function was introduced in netlink so a backport is needed.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
 backport/backport-include/net/netlink.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
index 40160b5..b836a4b 100644
--- a/backport/backport-include/net/netlink.h
+++ b/backport/backport-include/net/netlink.h
@@ -189,4 +189,17 @@ static inline __le64 nla_get_le64(const struct nlattr *nla)
 }
 #endif /* < 4.4 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
+/**
+ * nla_memdup - duplicate attribute memory (kmemdup)
+ * @src: netlink attribute to duplicate from
+ * @gfp: GFP mask
+ */
+#define nla_memdump LINUX_BACKPORT(nla_memdup)
+static inline void *nla_memdup(const struct nlattr *src, gfp_t gfp)
+{
+	return kmemdup(nla_data(src), nla_len(src), gfp);
+}
+#endif /* < 4.9 */
+
 #endif /* __BACKPORT_NET_NETLINK_H */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-14 19:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-12 20:18 [PATCH 1/3] backports: add backport for nla_memdup() Arend van Spriel
2016-11-12 20:18 ` [PATCH 2/3] backports: add backport for genl_family_attrbuf() function Arend van Spriel
2016-11-12 20:18 ` [PATCH 3/3] backports: empty define for __ro_after_init Arend van Spriel
2016-11-12 21:07   ` Johannes Berg
2016-11-14 18:59     ` Luis R. Rodriguez
2016-11-14 19:26       ` Arend Van Spriel

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.