aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/device.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-04 10:44:42 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-04 11:08:29 -0600
commit6214b358a5502915d977d3f850d34bcad71c4cde (patch)
tree3f8849570e0ecbb60e9778ab38225705e1f46101 /src/device.c
parentglobal: satisfy check_patch.pl errors (diff)
downloadwireguard-monolithic-historical-6214b358a5502915d977d3f850d34bcad71c4cde.tar.xz
wireguard-monolithic-historical-6214b358a5502915d977d3f850d34bcad71c4cde.zip
global: prefer sizeof(*pointer) when possible
Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c
index 5bdc649..255ad49 100644
--- a/src/device.c
+++ b/src/device.c
@@ -238,8 +238,7 @@ static void destruct(struct net_device *dev)
packet_queue_free(&wg->encrypt_queue, true);
rcu_barrier_bh(); /* Wait for all the peers to be actually freed. */
ratelimiter_uninit();
- memzero_explicit(&wg->static_identity,
- sizeof(struct noise_static_identity));
+ memzero_explicit(&wg->static_identity, sizeof(wg->static_identity));
skb_queue_purge(&wg->incoming_handshakes);
free_percpu(dev->tstats);
free_percpu(wg->incoming_handshakes_worker);
@@ -285,7 +284,7 @@ static void setup(struct net_device *dev)
/* We need to keep the dst around in case of icmp replies. */
netif_keep_dst(dev);
- memset(wg, 0, sizeof(struct wireguard_device));
+ memset(wg, 0, sizeof(*wg));
wg->dev = dev;
}