]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests: txring_overwrite: fix incorrect test of mmap() return value
authorFrank de Brabander <debrabander@gmail.com>
Fri, 5 Jul 2019 11:43:14 +0000 (13:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jul 2019 06:27:19 +0000 (08:27 +0200)
commit935d592ce7c8d810740eebec7205b3fe9e8ad5ff
tree3a6c3672ec5e92eb967d38b24fd45f14727254e6
parent2f9874a15fd0166e082eb221c89ddd43e2267630
selftests: txring_overwrite: fix incorrect test of mmap() return value

[ Upstream commit cecaa76b2919aac2aa584ce476e9fcd5b084add5 ]

If mmap() fails it returns MAP_FAILED, which is defined as ((void *) -1).
The current if-statement incorrectly tests if *ring is NULL.

Fixes: 358be656406d ("selftests/net: add txring_overwrite")
Signed-off-by: Frank de Brabander <debrabander@gmail.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/net/txring_overwrite.c