diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-04-20 18:34:20 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-04-20 18:34:20 +0300 |
commit | f7ea285b6266822bd63af2a3695f03e3357fd74f (patch) | |
tree | ad5d6f3bab25094c81a072fb56fcac2f50ed91ed /net/xdp/xdp_umem.c | |
parent | 97e130f63757ede9abc4a9ee42b5fcad466a8e97 (diff) | |
parent | c7582ff7ed388b803d083166514a4c8acd4ef57d (diff) | |
download | linux-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.c | 5 |
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; |