From 2bb5c9cb46965521c9931ff732f2aa797598f373 Mon Sep 17 00:00:00 2001 From: Sandeep Singh Date: Wed, 27 Apr 2022 15:26:36 +0530 Subject: [PATCH] icnss2: Reject wlan host driver loading Reject wlan host driver loading if wlan driver dev_info is null. Wlan host driver needs to pass correct dev_info to get driver loaded. Change-Id: I6b4e94c42c6192a063d0e3ccf20deb73714fab8c CRs-Fixed: 3178902 --- icnss2/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/icnss2/main.c b/icnss2/main.c index 03866dc5b8..fd426e6a1f 100644 --- a/icnss2/main.c +++ b/icnss2/main.c @@ -2455,11 +2455,6 @@ enable_pdr: static int icnss_dev_id_match(struct icnss_priv *priv, struct device_info *dev_info) { - if (!dev_info) { - icnss_pr_info("WLAN driver devinfo is null, Continue driver loading"); - return 1; - } - while (dev_info->device_id) { if (priv->device_id == dev_info->device_id) return 1; @@ -2662,6 +2657,11 @@ int __icnss_register_driver(struct icnss_driver_ops *ops, goto out; } + if (!ops->dev_info) { + icnss_pr_err("WLAN driver devinfo is null, Reject wlan driver loading"); + return -EINVAL; + } + if (!icnss_dev_id_match(priv, ops->dev_info)) { icnss_pr_err("WLAN driver dev name is %s, not supported by platform driver\n", ops->dev_info->name);