Skip to contentSkip to conversation

batman-adv: add compat code for kmalloc_array()

PATCH Superseded Antonio Quartulli 1 participant 1 message Jun 13, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: add compat code for kmalloc_array()

kmalloc_array() was introduced with linux-3.3 therefore we need some compat code in order to be able to compile batman-adv against older kernels.

---
 compat.h | 2 ++
 1 file changed, 2 insertions(+)
compat.h +2 -0
index 5eb5fe6..28f4cfe 100644
@@ -274,6 +274,8 @@ static inline void batadv_eth_hw_addr_random(struct net_device *dev)
 	random_ether_addr(dev->dev_addr);
 }
 
+#define kmalloc_array(n, size, flags) kmalloc(n * size, flags)
+
 #endif /* < KERNEL_VERSION(3, 4, 0) */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
Signature · 1 line
1.8.5.5