We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3bd916e commit 5eaed6eCopy full SHA for 5eaed6e
include/linux/bpf.h
@@ -209,11 +209,9 @@ static inline bool map_value_has_timer(const struct bpf_map *map)
209
static inline void check_and_init_map_value(struct bpf_map *map, void *dst)
210
{
211
if (unlikely(map_value_has_spin_lock(map)))
212
- *(struct bpf_spin_lock *)(dst + map->spin_lock_off) =
213
- (struct bpf_spin_lock){};
+ memset(dst + map->spin_lock_off, 0, sizeof(struct bpf_spin_lock));
214
if (unlikely(map_value_has_timer(map)))
215
- *(struct bpf_timer *)(dst + map->timer_off) =
216
- (struct bpf_timer){};
+ memset(dst + map->timer_off, 0, sizeof(struct bpf_timer));
217
}
218
219
/* copy everything but bpf_spin_lock and bpf_timer. There could be one of each. */
0 commit comments