提交 757be186 编写于 作者: N Neil Horman 提交者: Linus Torvalds

[PATCH] sh: fix proc file removal for superh store queue module

Clean up proc file removal in sq module for superh arch.  currently on a
failed module load or on module unload a proc file is left registered which
can cause a random memory execution or oopses if read after unload.  This
patch cleans up that deregistration.
Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
Acked-by: NPaul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 453c3e47
......@@ -421,18 +421,22 @@ static struct miscdevice sq_dev = {
static int __init sq_api_init(void)
{
int ret;
printk(KERN_NOTICE "sq: Registering store queue API.\n");
#ifdef CONFIG_PROC_FS
create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);
#endif
return misc_register(&sq_dev);
ret = misc_register(&sq_dev);
if (ret)
remove_proc_entry("sq_mapping", NULL);
return ret;
}
static void __exit sq_api_exit(void)
{
misc_deregister(&sq_dev);
remove_proc_entry("sq_mapping", NULL);
}
module_init(sq_api_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册