mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
[PATCH] kernel/params: driver layer error checking
Check driver layer return values in kernel/params.c Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
5906e4171a
commit
d8c7649e99
1 changed files with 11 additions and 2 deletions
|
@ -547,6 +547,7 @@ static void __init kernel_param_sysfs_setup(const char *name,
|
||||||
unsigned int name_skip)
|
unsigned int name_skip)
|
||||||
{
|
{
|
||||||
struct module_kobject *mk;
|
struct module_kobject *mk;
|
||||||
|
int ret;
|
||||||
|
|
||||||
mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL);
|
mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL);
|
||||||
BUG_ON(!mk);
|
BUG_ON(!mk);
|
||||||
|
@ -554,7 +555,8 @@ static void __init kernel_param_sysfs_setup(const char *name,
|
||||||
mk->mod = THIS_MODULE;
|
mk->mod = THIS_MODULE;
|
||||||
kobj_set_kset_s(mk, module_subsys);
|
kobj_set_kset_s(mk, module_subsys);
|
||||||
kobject_set_name(&mk->kobj, name);
|
kobject_set_name(&mk->kobj, name);
|
||||||
kobject_register(&mk->kobj);
|
ret = kobject_register(&mk->kobj);
|
||||||
|
BUG_ON(ret < 0);
|
||||||
|
|
||||||
/* no need to keep the kobject if no parameter is exported */
|
/* no need to keep the kobject if no parameter is exported */
|
||||||
if (!param_sysfs_setup(mk, kparam, num_params, name_skip)) {
|
if (!param_sysfs_setup(mk, kparam, num_params, name_skip)) {
|
||||||
|
@ -684,7 +686,14 @@ decl_subsys(module, &module_ktype, NULL);
|
||||||
*/
|
*/
|
||||||
static int __init param_sysfs_init(void)
|
static int __init param_sysfs_init(void)
|
||||||
{
|
{
|
||||||
subsystem_register(&module_subsys);
|
int ret;
|
||||||
|
|
||||||
|
ret = subsystem_register(&module_subsys);
|
||||||
|
if (ret < 0) {
|
||||||
|
printk(KERN_WARNING "%s (%d): subsystem_register error: %d\n",
|
||||||
|
__FILE__, __LINE__, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
param_sysfs_builtin();
|
param_sysfs_builtin();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue