OSDN Git Service

nl80211: use for_each_element() in validate_ie_attr()
authorJohannes Berg <johannes.berg@intel.com>
Thu, 7 Feb 2019 22:39:19 +0000 (23:39 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 8 Feb 2019 12:51:50 +0000 (13:51 +0100)
commit9f308616b6176b6dc470e6eb3569a09b100a823a
tree58e9c9b69fed05c19470df6fc362678c413fc04a
parent49a68e0d88890060a2b9b6c6ad1ec53eb50abccf
nl80211: use for_each_element() in validate_ie_attr()

This makes for much simpler code, simply walk through all
the elements and check that the last one found ends with
the end of the data. This works because if any element is
malformed the walk is aborted, we end up with a mismatch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c