]> 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:28:34 +0000 (08:28 +0200)
commitd7728216dee122a21fe8732c4f202301a07cdd60
tree2eb0c1bbed60fff51f57034f0910b211d7bd1311
parent1cec7a0cf072a8b0039abaa88c73256f6d82bf4e
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