Skip to content

Commit de3f64b

Browse files
tititiou36jwrdegoede
authored andcommitted
vboxsf: Avoid an spurious warning if load_nls_xxx() fails
If an load_nls_xxx() function fails a few lines above, the 'sbi->bdi_id' is still 0. So, in the error handling path, we will call ida_simple_remove(..., 0) which is not allocated yet. In order to prevent a spurious "ida_free called for id=0 which is not allocated." message, tweak the error handling path and add a new label. Fixes: 0fd1695 ("fs: Add VirtualBox guest shared folder (vboxsf) support") Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/d09eaaa4e2e08206c58a1a27ca9b3e81dc168773.1698835730.git.christophe.jaillet@wanadoo.fr Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 0200cee commit de3f64b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/vboxsf/super.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
151151
if (!sbi->nls) {
152152
vbg_err("vboxsf: Count not load '%s' nls\n", nls_name);
153153
err = -EINVAL;
154-
goto fail_free;
154+
goto fail_destroy_idr;
155155
}
156156
}
157157

@@ -224,6 +224,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
224224
ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
225225
if (sbi->nls)
226226
unload_nls(sbi->nls);
227+
fail_destroy_idr:
227228
idr_destroy(&sbi->ino_idr);
228229
kfree(sbi);
229230
return err;

0 commit comments

Comments
 (0)