summaryrefslogtreecommitdiff
path: root/net/xdp/xdp_umem.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-04-20 18:34:20 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-04-20 18:34:20 +0300
commitf7ea285b6266822bd63af2a3695f03e3357fd74f (patch)
treead5d6f3bab25094c81a072fb56fcac2f50ed91ed /net/xdp/xdp_umem.c
parent97e130f63757ede9abc4a9ee42b5fcad466a8e97 (diff)
parentc7582ff7ed388b803d083166514a4c8acd4ef57d (diff)
downloadlinux-f7ea285b6266822bd63af2a3695f03e3357fd74f.tar.xz
Merge branch 'ib-pdx86-properties'
Merge branch 'ib-pdx86-properties' of git://git.infradead.org/linux-platform-drivers-x86.git to avoid conflicts in PDx86. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'net/xdp/xdp_umem.c')
-rw-r--r--net/xdp/xdp_umem.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
index fa7bb5e060d0..ed7a6060f73c 100644
--- a/net/xdp/xdp_umem.c
+++ b/net/xdp/xdp_umem.c
@@ -343,7 +343,7 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
u32 chunk_size = mr->chunk_size, headroom = mr->headroom;
unsigned int chunks, chunks_per_page;
u64 addr = mr->addr, size = mr->len;
- int size_chk, err;
+ int err;
if (chunk_size < XDP_UMEM_MIN_CHUNK_SIZE || chunk_size > PAGE_SIZE) {
/* Strictly speaking we could support this, if:
@@ -382,8 +382,7 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
return -EINVAL;
}
- size_chk = chunk_size - headroom - XDP_PACKET_HEADROOM;
- if (size_chk < 0)
+ if (headroom >= chunk_size - XDP_PACKET_HEADROOM)
return -EINVAL;
umem->address = (unsigned long)addr;