summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2020-03-01 09:51:21 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2020-03-10 08:44:02 +0000
commitea7201620ceafab72b37e65bea4ec461dd27089d (patch)
tree5e6b887f0c53e4620e11959b375ebae184992e96
parentc71ad1764a07b4be9b04c56fd0d199c0f547404a (diff)
downloadillumos-joyent-ea7201620ceafab72b37e65bea4ec461dd27089d.tar.gz
12355 vnic_unicast_add() can return uninitialised diag value
Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Dominik Hassler <hadfl@omniosce.org> Approved by: Joshua M. Clulow <josh@sysmgr.org>
-rw-r--r--usr/src/uts/common/io/mac/mac_client.c5
-rw-r--r--usr/src/uts/common/io/vnic/vnic_dev.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/usr/src/uts/common/io/mac/mac_client.c b/usr/src/uts/common/io/mac/mac_client.c
index c39e3fa12f..779bdf204a 100644
--- a/usr/src/uts/common/io/mac/mac_client.c
+++ b/usr/src/uts/common/io/mac/mac_client.c
@@ -23,6 +23,7 @@
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2018 Joyent, Inc.
* Copyright 2017 RackTop Systems.
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
*/
/*
@@ -1286,7 +1287,7 @@ mac_addr_random(mac_client_handle_t mch, uint_t prefix_len,
prefix_len, addr_len - prefix_len);
}
- *diag = 0;
+ *diag = MAC_DIAG_NONE;
return (0);
}
@@ -2524,6 +2525,8 @@ i_mac_unicast_add(mac_client_handle_t mch, uint8_t *mac_addr, uint16_t flags,
*/
ASSERT(!((mip->mi_state_flags & MIS_IS_VNIC) && (vid != VLAN_ID_NONE)));
+ *diag = MAC_DIAG_NONE;
+
/*
* Can't unicast add if the client asked only for minimal datapath
* setup.
diff --git a/usr/src/uts/common/io/vnic/vnic_dev.c b/usr/src/uts/common/io/vnic/vnic_dev.c
index da52d7bb37..bbbd9b46bd 100644
--- a/usr/src/uts/common/io/vnic/vnic_dev.c
+++ b/usr/src/uts/common/io/vnic/vnic_dev.c
@@ -22,6 +22,7 @@
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2018 Joyent, Inc.
* Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
@@ -198,7 +199,7 @@ vnic_unicast_add(vnic_t *vnic, vnic_mac_addr_type_t vnic_addr_type,
uint8_t *mac_addr_arg, uint16_t flags, vnic_ioc_diag_t *diag,
uint16_t vid, boolean_t req_hwgrp_flag)
{
- mac_diag_t mac_diag;
+ mac_diag_t mac_diag = MAC_DIAG_NONE;
uint16_t mac_flags = 0;
int err;
uint_t addr_len;