wifi: avoid offset calculation on NULL pointer