summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-03-06 12:46:14 +0100
committerKalle Valo <kvalo@codeaurora.org>2019-04-25 18:38:26 +0200
commit444efbde32816a950c1749582f2e9241e3d5ee80 (patch)
tree33588e9bf07afbfe9dc19ef5a9847487f870a51c
parentrndis_wlan: use struct_size() helper (diff)
downloadlinux-444efbde32816a950c1749582f2e9241e3d5ee80.tar.xz
linux-444efbde32816a950c1749582f2e9241e3d5ee80.zip
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>
-rw-r--r--drivers/net/wireless/ray_cs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 44a943d18b84..d5616592fc19 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -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);