Skip to content

Commit bbb67d4

Browse files
zijun-huAndreas Hindborg
authored andcommitted
configfs: Correct error value returned by API config_item_set_name()
kvasprintf() failure is often caused by memory allocation which has error code -ENOMEM, but config_item_set_name() returns -EFAULT for the failure. Fix by returning -ENOMEM instead of -EFAULT for the failure. Reviewed-by: Joel Becker <[email protected]> Reviewed-by: Breno Leitao <[email protected]> Signed-off-by: Zijun Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Andreas Hindborg <[email protected]>
1 parent f830edb commit bbb67d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/configfs/item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ int config_item_set_name(struct config_item *item, const char *fmt, ...)
6666
name = kvasprintf(GFP_KERNEL, fmt, args);
6767
va_end(args);
6868
if (!name)
69-
return -EFAULT;
69+
return -ENOMEM;
7070
}
7171

7272
/* Free the old name, if necessary. */

0 commit comments

Comments
 (0)