[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1363675621-31186-2-git-send-email-haodong@linux.vnet.ibm.com>
Date: Tue, 19 Mar 2013 14:47:00 +0800
From: Dong Hao <haodong@...ux.vnet.ibm.com>
To: gregkh@...uxfoundation.org
Cc: xiaoguangrong@...ux.vnet.ibm.com, shangw@...ux.vnet.ibm.com,
weiyang@...ux.vnet.ibm.com, linux-kernel@...r.kernel.org,
Dong Hao <haodong@...ux.vnet.ibm.com>
Subject: [PATCH 2/3] lib/kobject: Panic when kobj or ktype is not properly assigned
From: Dong Hao <haodong@...ux.vnet.ibm.com>
kobj and ktype are two important attributes which will be used after kobject_init(),
and (!kobj)|(!ktype) may cause FS corruption which could not be recovered.
Panic instead of dump_stack() when neither kobj nor ktype is properly assigned to
detect the bug early.
Signed-off-by: Dong Hao <haodong@...ux.vnet.ibm.com>
---
lib/kobject.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/kobject.c b/lib/kobject.c
index 279a172..ff9b3c3 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -290,7 +290,7 @@ void kobject_init(struct kobject *kobj, struct kobj_type *ktype)
error:
printk(KERN_ERR "kobject (%p): %s\n", kobj, err_str);
- dump_stack();
+ BUG_ON(1);
}
EXPORT_SYMBOL(kobject_init);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists