summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-12-31 11:54:43 +0200
committerToomas Soome <tsoome@me.com>2020-04-07 08:45:45 +0300
commit1c189586e43914686758de5408f8a41d8a39528e (patch)
tree151e2ec651682994a7ee07e403acacf364aa4ec5
parentc846684c3d36ea4ee89b2cdeb2738e6521376e5a (diff)
downloadillumos-joyent-1c189586e43914686758de5408f8a41d8a39528e.tar.gz
12410 bpf: variable may be used uninitialized
Reviewed by: Yuri Pankov <ypankov@fastmail.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/uts/common/io/bpf/bpf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr/src/uts/common/io/bpf/bpf.c b/usr/src/uts/common/io/bpf/bpf.c
index 0911020cd6..2d0c266d3d 100644
--- a/usr/src/uts/common/io/bpf/bpf.c
+++ b/usr/src/uts/common/io/bpf/bpf.c
@@ -256,6 +256,8 @@ bpf_attachd(struct bpf_d *d, const char *ifname, int dlt)
ASSERT(d->bd_mcip == (uintptr_t)NULL);
zone = d->bd_zone;
zonematch = B_TRUE;
+ error = 0;
+ bpr = NULL;
again:
mh = 0;
mcip = 0;
@@ -312,6 +314,10 @@ next:
return (error);
}
+ /* No providers? */
+ if (bpr == NULL)
+ return (ENOENT);
+
d->bd_mac = *bpr;
d->bd_mcip = mcip;
d->bd_bif = mh;