Re: [PATCH] exporting capability code/name pairs (try #5)

From: Li Zefan
Date: Thu Feb 14 2008 - 21:00:33 EST


Kohei KaiGai wrote:

<...snip...>

> +static int __init capability_export_names(void)
> +{
> + /* make /sys/kernel/capability */
> + capability_kobj = kobject_create_and_add("capability", kernel_kobj);
> + if (!capability_kobj)
> + goto error0;
> +
> + /* make /sys/kernel/capability/names */
> + if (sysfs_create_group(capability_kobj,
> + &capability_name_attr_group))
> + goto error1;
> +
> + /* make /sys/kernel/capability/codes */
> + if (sysfs_create_group(capability_kobj,
> + &capability_code_attr_group))
> + goto error2;
> +
> + if (sysfs_create_file(capability_kobj,
> + &cap_version_attr.attr))
> + goto error3;
> +
> + return 0;
> +
> +error3:
> + sysfs_remove_group(capability_kobj, &capability_code_attr_group);
> +error2:
> + sysfs_remove_group(capability_kobj, &capability_name_attr_group);
> +error1:
> + kobject_put(capability_kobj);
> +error0:
> + printk(KERN_ERR "Unable to export capabilities\n");
> +
> + return 0;

Should return -EFXXX ..

> +}
> +__initcall(capability_export_names);
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/