diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-29 16:07:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-03 16:31:21 -0400 |
commit | cd3468bad96c00b5a512f551674f36776129520e (patch) | |
tree | b9b705149112b1403d5a23f09ae24a7eac515827 /net/wireless | |
parent | eb4ad826419ab5b1260bc1625249114767d36bea (diff) |
cfg80211: add two missing NULL pointer checks
These pointers can be NULL, the is_mesh() case isn't
ever hit in the current kernel, but cmp_ies() can be
hit under certain conditions.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: stable@kernel.org [2.6.29, 2.6.30]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/scan.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 9271118e1fc4..7e595ce24eeb 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -118,7 +118,7 @@ static int cmp_ies(u8 num, u8 *ies1, size_t len1, u8 *ies2, size_t len2) | |||
118 | 118 | ||
119 | if (!ie1 && !ie2) | 119 | if (!ie1 && !ie2) |
120 | return 0; | 120 | return 0; |
121 | if (!ie1) | 121 | if (!ie1 || !ie2) |
122 | return -1; | 122 | return -1; |
123 | 123 | ||
124 | r = memcmp(ie1 + 2, ie2 + 2, min(ie1[1], ie2[1])); | 124 | r = memcmp(ie1 + 2, ie2 + 2, min(ie1[1], ie2[1])); |
@@ -171,6 +171,8 @@ static bool is_mesh(struct cfg80211_bss *a, | |||
171 | ie = find_ie(WLAN_EID_MESH_CONFIG, | 171 | ie = find_ie(WLAN_EID_MESH_CONFIG, |
172 | a->information_elements, | 172 | a->information_elements, |
173 | a->len_information_elements); | 173 | a->len_information_elements); |
174 | if (!ie) | ||
175 | return false; | ||
174 | if (ie[1] != IEEE80211_MESH_CONFIG_LEN) | 176 | if (ie[1] != IEEE80211_MESH_CONFIG_LEN) |
175 | return false; | 177 | return false; |
176 | 178 | ||