aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/sched
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-04-03 16:25:51 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-04-03 16:25:51 +0000
commit21ff1f74695295f9563d12419ee1e2043187deda (patch)
treef9f65f78951f17015925de36d68a1b738189ec11 /sys/geom/sched
parentae26eab161bdd5b2a458df02b7c3908316e6f4fc (diff)
downloadsrc-21ff1f74695295f9563d12419ee1e2043187deda.tar.gz
src-21ff1f74695295f9563d12419ee1e2043187deda.zip
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
Notes
Notes: svn path=/head/; revision=297526
Diffstat (limited to 'sys/geom/sched')
-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 ea1fd413fc5c..d4e3ca026ade 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);