mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 20:40:52 +07:00
selftests: txring_overwrite: fix incorrect test of mmap() return value
If mmap() fails it returns MAP_FAILED, which is defined as ((void *) -1).
The current if-statement incorrectly tests if *ring is NULL.
Fixes: 358be65640
("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>
This commit is contained in:
parent
dd006fc434
commit
cecaa76b29
@ -113,7 +113,7 @@ static int setup_tx(char **ring)
|
||||
|
||||
*ring = mmap(0, req.tp_block_size * req.tp_block_nr,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, fdt, 0);
|
||||
if (!*ring)
|
||||
if (*ring == MAP_FAILED)
|
||||
error(1, errno, "mmap");
|
||||
|
||||
return fdt;
|
||||
|
Loading…
Reference in New Issue
Block a user