Skip to content

Commit e39fcae

Browse files
Wei Yongjungregkh
authored andcommitted
staging: Fix error return code in vboxsf_fill_super()
Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: df40286 ("staging: Add VirtualBox guest shared folder (vboxsf) support") Signed-off-by: Wei Yongjun <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 94fed40 commit e39fcae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/staging/vboxsf/super.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,10 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
176176
/* Turn source into a shfl_string and map the folder */
177177
size = strlen(fc->source) + 1;
178178
folder_name = kmalloc(SHFLSTRING_HEADER_SIZE + size, GFP_KERNEL);
179-
if (!folder_name)
179+
if (!folder_name) {
180+
err = -ENOMEM;
180181
goto fail_free;
182+
}
181183
folder_name->size = size;
182184
folder_name->length = size - 1;
183185
strlcpy(folder_name->string.utf8, fc->source, size);

0 commit comments

Comments
 (0)