mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
qcacld-3.0: Fix data hiding violation in __iw_get_char_setnone()
Currently in __iw_get_char_setnone() while processing the WE_GET_STATES ioctl a call is made to PMAC_STRUCT() to convert a HAL handle into a tpAniSirGlobal (aka pMac). This is a data hiding violation since use of pMac should be constrained to the UMAC -- HDD should not be utilizing this data structure. And it turns out that after PMAC_STRUCT() is called the resulting pMac actually isn't used other than testing for NULL. Furthermore this is dead code since the HAL handle was already tested for NULL and hence the pMac could never be NULL at the point it is tested. So fix this data hiding violation by completely removing the code that populates and tests pMac. Change-Id: I73fc7c388f4482e5c483a4982231f934cc80ef6c CRs-Fixed: 2232897
This commit is contained in:
parent
00052ddea9
commit
2a8a64f5cf
1 changed files with 3 additions and 14 deletions
|
|
@ -6441,7 +6441,6 @@ static int __iw_get_char_setnone(struct net_device *dev,
|
|||
int count = 0, check = 1;
|
||||
|
||||
tHalHandle hHal = NULL;
|
||||
tpAniSirGlobal pMac = NULL;
|
||||
struct hdd_station_ctx *sta_ctx = NULL;
|
||||
|
||||
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
|
|
@ -6495,19 +6494,9 @@ static int __iw_get_char_setnone(struct net_device *dev,
|
|||
|
||||
hHal = WLAN_HDD_GET_HAL_CTX(useAdapter);
|
||||
if (!hHal) {
|
||||
buf =
|
||||
scnprintf(extra + len,
|
||||
WE_MAX_STR_LEN - len,
|
||||
"\n pMac is NULL");
|
||||
len += buf;
|
||||
break;
|
||||
}
|
||||
pMac = PMAC_STRUCT(hHal);
|
||||
if (!pMac) {
|
||||
buf =
|
||||
scnprintf(extra + len,
|
||||
WE_MAX_STR_LEN - len,
|
||||
"\n pMac is NULL");
|
||||
buf = scnprintf(extra + len,
|
||||
WE_MAX_STR_LEN - len,
|
||||
"\n hHal is NULL");
|
||||
len += buf;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue