diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-05-02 06:36:14 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-05-02 06:36:14 +0000 |
commit | e65ab0f83f84e205c339b85421539b507c43b978 (patch) | |
tree | f30ff1854b1e718bcb5d94f16dcee4c13b5afe1a /sys/geom/geom_vol_ffs.c | |
parent | 4f806d2428f2f1f8692f61976b935a1429e6fecc (diff) | |
download | src-e65ab0f83f84e205c339b85421539b507c43b978.tar.gz src-e65ab0f83f84e205c339b85421539b507c43b978.zip |
Use g_slice_spoiled() rather than g_std_spoiled().
Remember to free the buffer we got from g_read_data().
Notes
Notes:
svn path=/head/; revision=114508
Diffstat (limited to 'sys/geom/geom_vol_ffs.c')
-rw-r--r-- | sys/geom/geom_vol_ffs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/geom/geom_vol_ffs.c b/sys/geom/geom_vol_ffs.c index a01af4dc7af5..7fedfc195c88 100644 --- a/sys/geom/geom_vol_ffs.c +++ b/sys/geom/geom_vol_ffs.c @@ -89,8 +89,12 @@ g_vol_ffs_taste(struct g_class *mp, struct g_provider *pp, int flags) for (sb=0; (superblock = superblocks[sb]) != -1; sb++) { fs = (struct fs *) g_read_data(cp, superblock, SBLOCKSIZE, &error); - if (fs == NULL || error != 0) + if (fs == NULL) continue; + if (error != 0) { + g_free(fs); + continue; + } /* Check for magic and make sure things are the right size */ if (fs->fs_magic == FS_UFS1_MAGIC) { if (fs->fs_old_size * fs->fs_fsize != @@ -128,7 +132,7 @@ g_vol_ffs_taste(struct g_class *mp, struct g_provider *pp, int flags) g_topology_lock(); g_access_rel(cp, -1, 0, 0); if (LIST_EMPTY(&gp->provider)) { - g_std_spoiled(cp); + g_slice_spoiled(cp); return (NULL); } return (gp); |