ipw2x00: remove unused ->ibss_dfs pointer

The ->ibss_dfs pointer is always allocated with a user controlled
length.  This caused a static checker warning because what if the length
was zero?  In that case, any dereference of ->ibss_dfs would lead to an
Oops.

It turns out that this isn't a problem because the ->ibss_dfs pointer is
never used.  This patch deletes it along with all the related code.  In
particular the entire libipw_network_reset() function can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Dan Carpenter
2014-10-09 12:57:42 +03:00
committed by John W. Linville
parent e9dc51aa2b
commit 2aa01652cf
3 changed files with 3 additions and 38 deletions

View File

@@ -84,25 +84,12 @@ static int libipw_networks_allocate(struct libipw_device *ieee)
return 0;
}
void libipw_network_reset(struct libipw_network *network)
{
if (!network)
return;
if (network->ibss_dfs) {
kfree(network->ibss_dfs);
network->ibss_dfs = NULL;
}
}
static inline void libipw_networks_free(struct libipw_device *ieee)
{
int i;
for (i = 0; i < MAX_NETWORK_COUNT; i++) {
kfree(ieee->networks[i]->ibss_dfs);
for (i = 0; i < MAX_NETWORK_COUNT; i++)
kfree(ieee->networks[i]);
}
}
void libipw_networks_age(struct libipw_device *ieee,