cobalt: rename config file
[openwrt.git] / package / kernel / mac80211 / patches / 081-backport-devm_kmemdup.patch
1 --- a/backport-include/linux/device.h
2 +++ b/backport-include/linux/device.h
3 @@ -200,4 +200,20 @@ static inline void *devm_kmemdup(struct
4  #endif
5  
6  
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
8 +#define devm_kmemdup LINUX_BACKPORT(devm_kmemdup)
9 +static inline void *devm_kmemdup(struct device *dev, const void *src,
10 +                                size_t len, gfp_t gfp)
11 +{
12 +       void *p;
13 +
14 +       p = devm_kmalloc(dev, len, gfp);
15 +       if (p)
16 +               memcpy(p, src, len);
17 +
18 +       return p;
19 +}
20 +#endif
21 +
22 +
23  #endif /* __BACKPORT_DEVICE_H */