p54: fix eeprom parser length sanity checks
When I called p54_parse_eeprom() on a hand-coded structure I managed to make a small mistake with wrap->len which caused a segfault a few lines down when trying to read entry->len. This patch changes the validation code to avoid such problems. Signed-off-by: NJohannes Berg <johannes@sipsolutions.net> Tested-by: NFlorian Fainelli <florian.fainelli@telecomint.eu> Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
Showing
想要评论请 注册 或 登录