diff options
Diffstat (limited to 'net/core')
| -rw-r--r-- | net/core/dev.c | 7 | ||||
| -rw-r--r-- | net/core/dst.c | 10 |
2 files changed, 14 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index f91abf800161..a39354ee1432 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -1055,6 +1055,8 @@ rollback: | |||
| 1055 | */ | 1055 | */ |
| 1056 | int dev_set_alias(struct net_device *dev, const char *alias, size_t len) | 1056 | int dev_set_alias(struct net_device *dev, const char *alias, size_t len) |
| 1057 | { | 1057 | { |
| 1058 | char *new_ifalias; | ||
| 1059 | |||
| 1058 | ASSERT_RTNL(); | 1060 | ASSERT_RTNL(); |
| 1059 | 1061 | ||
| 1060 | if (len >= IFALIASZ) | 1062 | if (len >= IFALIASZ) |
| @@ -1068,9 +1070,10 @@ int dev_set_alias(struct net_device *dev, const char *alias, size_t len) | |||
| 1068 | return 0; | 1070 | return 0; |
| 1069 | } | 1071 | } |
| 1070 | 1072 | ||
| 1071 | dev->ifalias = krealloc(dev->ifalias, len + 1, GFP_KERNEL); | 1073 | new_ifalias = krealloc(dev->ifalias, len + 1, GFP_KERNEL); |
| 1072 | if (!dev->ifalias) | 1074 | if (!new_ifalias) |
| 1073 | return -ENOMEM; | 1075 | return -ENOMEM; |
| 1076 | dev->ifalias = new_ifalias; | ||
| 1074 | 1077 | ||
| 1075 | strlcpy(dev->ifalias, alias, len+1); | 1078 | strlcpy(dev->ifalias, alias, len+1); |
| 1076 | return len; | 1079 | return len; |
diff --git a/net/core/dst.c b/net/core/dst.c index 069d51d29414..56d63612e1e4 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
| @@ -149,7 +149,15 @@ int dst_discard(struct sk_buff *skb) | |||
| 149 | } | 149 | } |
| 150 | EXPORT_SYMBOL(dst_discard); | 150 | EXPORT_SYMBOL(dst_discard); |
| 151 | 151 | ||
| 152 | const u32 dst_default_metrics[RTAX_MAX]; | 152 | const u32 dst_default_metrics[RTAX_MAX + 1] = { |
| 153 | /* This initializer is needed to force linker to place this variable | ||
| 154 | * into const section. Otherwise it might end into bss section. | ||
| 155 | * We really want to avoid false sharing on this variable, and catch | ||
| 156 | * any writes on it. | ||
| 157 | */ | ||
| 158 | [RTAX_MAX] = 0xdeadbeef, | ||
| 159 | }; | ||
| 160 | |||
| 153 | 161 | ||
| 154 | void *dst_alloc(struct dst_ops *ops, struct net_device *dev, | 162 | void *dst_alloc(struct dst_ops *ops, struct net_device *dev, |
| 155 | int initial_ref, int initial_obsolete, unsigned short flags) | 163 | int initial_ref, int initial_obsolete, unsigned short flags) |
