Jelajahi Sumber

qcacld-3.0: Free memory properly during wow pattern config command

In error case during wow pattern add and delete the allocated
memory for pattern string is not freed which is leading to memory
leak. Add the fix to free the allocated memory for wow pattern
properly for both error and success cases.

Change-Id: I5ecc2fb710bba85369a0bacbdd69a039d295e4d8
CRs-Fixed: 2609247
Rajeev Kumar 5 tahun lalu
induk
melakukan
5bcbae4d46
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      core/hdd/src/wlan_hdd_wext.c

+ 2 - 2
core/hdd/src/wlan_hdd_wext.c

@@ -5975,12 +5975,12 @@ static int __iw_setchar_getnone(struct net_device *dev,
 	case WE_WOWL_ADD_PTRN:
 		hdd_debug("ADD_PTRN");
 		if (!hdd_add_wowl_ptrn(adapter, str_arg))
-			return -EINVAL;
+			ret = -EINVAL;
 		break;
 	case WE_WOWL_DEL_PTRN:
 		hdd_debug("DEL_PTRN");
 		if (!hdd_del_wowl_ptrn(adapter, str_arg))
-			return -EINVAL;
+			ret = -EINVAL;
 		break;
 	case WE_NEIGHBOR_REPORT_REQUEST:
 	{