Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

driver core: devtmpfs: fix compile failure with CONFIG_UIDGID_STRICT_TYPE_CHECKS

If CONFIG_UIDGID_STRICT_TYPE_CHECKS is enalbed, the below compile
failure will be triggered:

drivers/base/devtmpfs.c: In function 'handle_create':
drivers/base/devtmpfs.c:214:19: error: incompatible types when assigning to type 'kuid_t' from type 'uid_t'
drivers/base/devtmpfs.c:215:19: error: incompatible types when assigning to type 'kgid_t' from type 'gid_t'
make[2]: *** [drivers/base/devtmpfs.o] Error 1

This patch fixes the compile failure.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ming Lei and committed by
Greg Kroah-Hartman
d81c8d19 c3a30420

+2 -2
+2 -2
drivers/base/devtmpfs.c
··· 212 212 struct iattr newattrs; 213 213 214 214 newattrs.ia_mode = mode; 215 - newattrs.ia_uid = uid; 216 - newattrs.ia_gid = gid; 215 + newattrs.ia_uid = KUIDT_INIT(uid); 216 + newattrs.ia_gid = KGIDT_INIT(gid); 217 217 newattrs.ia_valid = ATTR_MODE|ATTR_UID|ATTR_GID; 218 218 mutex_lock(&dentry->d_inode->i_mutex); 219 219 notify_change(dentry, &newattrs);