Hello Oleg Drokin,
The patch 8b8284450569: "staging/lustre: Move /proc/fs/lustre root
level files to sysfs" from May 21, 2015, leads to the following
static checker warning:
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c:431
class_procfs_init()
warn: missing error code here? 'kobject_create_and_add()' failed. 'rc'
= '0'
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
424 int class_procfs_init(void)
425 {
426 int rc = 0;
427 struct dentry *file;
428
429 lustre_kobj = kobject_create_and_add("lustre", fs_kobj);
430 if (lustre_kobj == NULL)
431 goto out;
^^^^^^^^
This do nothing label introduces a forgot to set the error code bug.
432
433 /* Create the files associated with this kobject */
434 rc = sysfs_create_group(lustre_kobj, &lustre_attr_group);
435 if (rc) {
436 kobject_put(lustre_kobj);
437 goto out;
438 }
439
440 debugfs_lustre_root = debugfs_create_dir("lustre", NULL);
441 if (IS_ERR_OR_NULL(debugfs_lustre_root)) {
442 rc = debugfs_lustre_root ? PTR_ERR(debugfs_lustre_root)
443 : -ENOMEM;
444 debugfs_lustre_root = NULL;
445 kobject_put(lustre_kobj);
446 goto out;
447 }
448
449 file = debugfs_create_file("devices", 0444,
debugfs_lustre_root, NULL,
450 &obd_device_list_fops);
451 if (IS_ERR_OR_NULL(file)) {
452 rc = file ? PTR_ERR(file) : -ENOMEM;
453 kobject_put(lustre_kobj);
454 goto out;
455 }
456 out:
457 return rc;
458 }
regards,
dan carpenter
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel