From: Zijun Hu Date: Wed, 7 May 2025 11:50:27 +0000 (+0800) Subject: configfs: Correct error value returned by API config_item_set_name() X-Git-Tag: v6.16-rc1~213^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbb67d4f85fd00a216fca4ca048e15f8ff6a2195;p=thirdparty%2Flinux.git 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 Reviewed-by: Breno Leitao Signed-off-by: Zijun Hu Link: https://lore.kernel.org/r/20250507-fix_configfs-v3-3-fe2d96de8dc4@quicinc.com Signed-off-by: Andreas Hindborg --- diff --git a/fs/configfs/item.c b/fs/configfs/item.c index 254170a82aa33..c378b5cbf87d2 100644 --- a/fs/configfs/item.c +++ b/fs/configfs/item.c @@ -66,7 +66,7 @@ int config_item_set_name(struct config_item *item, const char *fmt, ...) name = kvasprintf(GFP_KERNEL, fmt, args); va_end(args); if (!name) - return -EFAULT; + return -ENOMEM; } /* Free the old name, if necessary. */