summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-03 16:25:51 +0000
committerpfg <pfg@FreeBSD.org>2016-04-03 16:25:51 +0000
commit858326e785b319d64e65979df01adf4dd7762fa4 (patch)
treef9f65f78951f17015925de36d68a1b738189ec11
parent2421c6baf24a5a07bb6211a713c19ab830fd37c1 (diff)
downloadFreeBSD-src-858326e785b319d64e65979df01adf4dd7762fa4.zip
FreeBSD-src-858326e785b319d64e65979df01adf4dd7762fa4.tar.gz
g_sched_destroy(): prevent return of uninitialized scalar variable.
For the !gsp case there some chance of returning an uninitialized return value. Prevent that from happening by initializing the error value. CID: 1006421
-rw-r--r--sys/geom/sched/g_sched.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/geom/sched/g_sched.c b/sys/geom/sched/g_sched.c
index ea1fd41..d4e3ca0 100644
--- a/sys/geom/sched/g_sched.c
+++ b/sys/geom/sched/g_sched.c
@@ -1316,7 +1316,8 @@ g_sched_destroy(struct g_geom *gp, boolean_t force)
gsp->gs_fini(sc->sc_data);
g_gsched_unref(gsp);
sc->sc_gsched = NULL;
- }
+ } else
+ error = 0;
if ((sc->sc_flags & G_SCHED_PROXYING) && oldpp) {
error = g_destroy_proxy(gp, oldpp);
OpenPOWER on IntegriCloud