From 4af39064e3e4a6e08f4d702092b1e4bfe3289be9 Mon Sep 17 00:00:00 2001 From: Marin Ramesa Date: Mon, 2 Dec 2013 23:30:03 +0100 Subject: device/net_io.c: initialize hash_entp to NULL * device/net_io.c (hash_entp): Initialize to NET_HASH_ENTRY_NULL. --- device/net_io.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/device/net_io.c b/device/net_io.c index 1958840..ee475ef 100644 --- a/device/net_io.c +++ b/device/net_io.c @@ -1158,7 +1158,7 @@ net_set_filter(ifp, rcv_port, priority, filter, filter_count) net_rcv_port_t infp, my_infp; net_rcv_port_t nextfp; net_hash_header_t hhp; - net_hash_entry_t entp, hash_entp; + net_hash_entry_t entp; net_hash_entry_t *head, nextentp; queue_entry_t dead_infp, dead_entp; int i; @@ -1166,6 +1166,13 @@ net_set_filter(ifp, rcv_port, priority, filter, filter_count) io_return_t rval; boolean_t in, out; + /* Initialize hash_entp to NULL to quiet GCC + * warning about uninitialized variable. hash_entp is only + * used when match != 0; in that case it is properly initialized + * by kmem_cache_alloc(). + */ + net_hash_entry_t hash_entp = NULL; + /* * Check the filter syntax. */ -- cgit v1.2.3