diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-03 16:25:51 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-03 16:25:51 +0000 |
commit | 858326e785b319d64e65979df01adf4dd7762fa4 (patch) | |
tree | f9f65f78951f17015925de36d68a1b738189ec11 /sys/geom | |
parent | 2421c6baf24a5a07bb6211a713c19ab830fd37c1 (diff) | |
download | FreeBSD-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
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/sched/g_sched.c | 3 |
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); |