Commit 5809a5d5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Johannes Berg

cfg80211: don't pass pointer to pointer unnecessarily

The cfg80211_merge_profile() and ieee802_11_find_bssid_profile() are
a bit cleaner if we just pass the merged_ie pointer instead of a pointer
to the pointer.

This isn't a functional change, it's just a clean up.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent ba905bf4
...@@ -5578,7 +5578,7 @@ bool cfg80211_is_element_inherited(const struct element *element, ...@@ -5578,7 +5578,7 @@ bool cfg80211_is_element_inherited(const struct element *element,
size_t cfg80211_merge_profile(const u8 *ie, size_t ielen, size_t cfg80211_merge_profile(const u8 *ie, size_t ielen,
const struct element *mbssid_elem, const struct element *mbssid_elem,
const struct element *sub_elem, const struct element *sub_elem,
u8 **merged_ie, size_t max_copy_len); u8 *merged_ie, size_t max_copy_len);
/** /**
* enum cfg80211_bss_frame_type - frame type that the BSS data came from * enum cfg80211_bss_frame_type - frame type that the BSS data came from
......
...@@ -1258,7 +1258,7 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len, ...@@ -1258,7 +1258,7 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len,
struct ieee802_11_elems *elems, struct ieee802_11_elems *elems,
u8 *transmitter_bssid, u8 *transmitter_bssid,
u8 *bss_bssid, u8 *bss_bssid,
u8 **nontransmitted_profile) u8 *nontransmitted_profile)
{ {
const struct element *elem, *sub; const struct element *elem, *sub;
size_t profile_len = 0; size_t profile_len = 0;
...@@ -1290,7 +1290,7 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len, ...@@ -1290,7 +1290,7 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len,
continue; continue;
} }
memset(*nontransmitted_profile, 0, len); memset(nontransmitted_profile, 0, len);
profile_len = cfg80211_merge_profile(start, len, profile_len = cfg80211_merge_profile(start, len,
elem, elem,
sub, sub,
...@@ -1299,7 +1299,7 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len, ...@@ -1299,7 +1299,7 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len,
/* found a Nontransmitted BSSID Profile */ /* found a Nontransmitted BSSID Profile */
index = cfg80211_find_ie(WLAN_EID_MULTI_BSSID_IDX, index = cfg80211_find_ie(WLAN_EID_MULTI_BSSID_IDX,
*nontransmitted_profile, nontransmitted_profile,
profile_len); profile_len);
if (!index || index[1] < 1 || index[2] == 0) { if (!index || index[1] < 1 || index[2] == 0) {
/* Invalid MBSSID Index element */ /* Invalid MBSSID Index element */
...@@ -1341,7 +1341,7 @@ u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, ...@@ -1341,7 +1341,7 @@ u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
ieee802_11_find_bssid_profile(start, len, elems, ieee802_11_find_bssid_profile(start, len, elems,
transmitter_bssid, transmitter_bssid,
bss_bssid, bss_bssid,
&nontransmitted_profile); nontransmitted_profile);
non_inherit = non_inherit =
cfg80211_find_ext_elem(WLAN_EID_EXT_NON_INHERITANCE, cfg80211_find_ext_elem(WLAN_EID_EXT_NON_INHERITANCE,
nontransmitted_profile, nontransmitted_profile,
......
...@@ -1502,7 +1502,7 @@ static const struct element ...@@ -1502,7 +1502,7 @@ static const struct element
size_t cfg80211_merge_profile(const u8 *ie, size_t ielen, size_t cfg80211_merge_profile(const u8 *ie, size_t ielen,
const struct element *mbssid_elem, const struct element *mbssid_elem,
const struct element *sub_elem, const struct element *sub_elem,
u8 **merged_ie, size_t max_copy_len) u8 *merged_ie, size_t max_copy_len)
{ {
size_t copied_len = sub_elem->datalen; size_t copied_len = sub_elem->datalen;
const struct element *next_mbssid; const struct element *next_mbssid;
...@@ -1510,7 +1510,7 @@ size_t cfg80211_merge_profile(const u8 *ie, size_t ielen, ...@@ -1510,7 +1510,7 @@ size_t cfg80211_merge_profile(const u8 *ie, size_t ielen,
if (sub_elem->datalen > max_copy_len) if (sub_elem->datalen > max_copy_len)
return 0; return 0;
memcpy(*merged_ie, sub_elem->data, sub_elem->datalen); memcpy(merged_ie, sub_elem->data, sub_elem->datalen);
while ((next_mbssid = cfg80211_get_profile_continuation(ie, ielen, while ((next_mbssid = cfg80211_get_profile_continuation(ie, ielen,
mbssid_elem, mbssid_elem,
...@@ -1519,7 +1519,7 @@ size_t cfg80211_merge_profile(const u8 *ie, size_t ielen, ...@@ -1519,7 +1519,7 @@ size_t cfg80211_merge_profile(const u8 *ie, size_t ielen,
if (copied_len + next_sub->datalen > max_copy_len) if (copied_len + next_sub->datalen > max_copy_len)
break; break;
memcpy(*merged_ie + copied_len, next_sub->data, memcpy(merged_ie + copied_len, next_sub->data,
next_sub->datalen); next_sub->datalen);
copied_len += next_sub->datalen; copied_len += next_sub->datalen;
} }
...@@ -1588,7 +1588,7 @@ static void cfg80211_parse_mbssid_data(struct wiphy *wiphy, ...@@ -1588,7 +1588,7 @@ static void cfg80211_parse_mbssid_data(struct wiphy *wiphy,
profile_len = cfg80211_merge_profile(ie, ielen, profile_len = cfg80211_merge_profile(ie, ielen,
elem, elem,
sub, sub,
&profile, profile,
ielen); ielen);
/* found a Nontransmitted BSSID Profile */ /* found a Nontransmitted BSSID Profile */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment