kernel/fs/sysfs/dir.c
.. .. @@ -6,7 +6,7 @@ 6 6 * Copyright (c) 2007 SUSE Linux Products GmbH 7 7 * Copyright (c) 2007 Tejun Heo <teheo@suse.de> 8 8 * 9 - * Please see Documentation/filesystems/sysfs.txt for more information.9 + * Please see Documentation/filesystems/sysfs.rst for more information.10 10 */ 11 11 12 12 #define pr_fmt(fmt) "sysfs: " fmt .. .. @@ -43,7 +43,8 @@ 43 43 kuid_t uid; 44 44 kgid_t gid; 45 45 46 - BUG_ON(!kobj);46 + if (WARN_ON(!kobj))47 + return -EINVAL;47 48 48 49 if (kobj->parent) 49 50 parent = kobj->parent->sd;