MFC r339581: Fix off-by-one which can lead to panics.
Found by: Peter Holm <peter@holm.cc> Sponsored by: Mellanox Technologies