ray_cs: Check return value of pcmcia_register_driver
init_ray_cs does not check value of pcmcia_register_driver, if it fails, there maybe cause a NULL pointer dereference in exit_ray_cs. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
d442af2e1b
commit
444efbde32
1 changed files with 2 additions and 0 deletions
|
@ -2795,6 +2795,8 @@ static int __init init_ray_cs(void)
|
|||
rc = pcmcia_register_driver(&ray_driver);
|
||||
pr_debug("raylink init_module register_pcmcia_driver returns 0x%x\n",
|
||||
rc);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
proc_mkdir("driver/ray_cs", NULL);
|
||||
|
|
Loading…
Reference in a new issue