qcacld-3.0: Check for null wlan kobject and return if true

Fix for null object dereference. Check for null wlan
kobject and return if true.

Change-Id: I90477335c81d44b9cc2762dd4060d9447a0bdb66
CRs-Fixed: 2717466
This commit is contained in:
Nisha Menon 2020-06-23 21:21:01 -07:00 • committed by nshrivas
commit caaec341cb

View file

@ -82,8 +82,10 @@ int hdd_sysfs_mem_stats_create(struct kobject *wlan_kobject)
void hdd_sysfs_mem_stats_destroy(struct kobject *wlan_kobject)
{
if (!wlan_kobject)
if (!wlan_kobject) {
hdd_err("Could not get wlan kobject!");
return;
}
sysfs_remove_file(wlan_kobject, &mem_stats_attribute.attr);
}