From 38bcc4081137740dc3e7a60209860ff63a04d43d Mon Sep 17 00:00:00 2001 From: Bapiraju Alla Date: Thu, 5 Nov 2020 10:48:28 +0530 Subject: [PATCH] qcacld-3.0: Remove unnecessary net_device validation Currently net_device is being validated inside the hdd_for_each_adapter_dev_held_safe loop. This is not required as hdd_for_each_adapter_dev_held_safe will hold the reference for net_device and prevent it from being deleted. So net_device validation is not required inside hdd_for_each_adapter_dev_held_safe loop. Change-Id: Id7e78748b80e7a3bbe50fee43a28fd0d48bd6856 CRs-Fixed: 2812716 --- core/hdd/src/wlan_hdd_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7005c34151e0..b31369e58908 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -14271,8 +14271,7 @@ static void hdd_state_info_dump(char **buf_ptr, uint16_t *size) hdd_ctx->is_scheduler_suspended); hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter) { - if (adapter->dev) - len += scnprintf(buf + len, *size - len, + len += scnprintf(buf + len, *size - len, "\n device name: %s", adapter->dev->name); len += scnprintf(buf + len, *size - len, "\n device_mode: %d", adapter->device_mode);