lkml.org 
[lkml]   [2015]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.19.y-ckt 063/130] net/xen-netback: off by one in BUG_ON() condition
    Date
    3.19.8-ckt6 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Dan Carpenter <dan.carpenter@oracle.com>

    commit 50c2e4dd6749725338621fff456b26d3a592259f upstream.

    The > should be >=. I also added spaces around the '-' operations so
    the code is a little more consistent and matches the condition better.

    Fixes: f53c3fe8dad7 ('xen-netback: Introduce TX grant mapping')
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Kamal Mostafa <kamal@canonical.com>
    ---
    drivers/net/xen-netback/netback.c | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
    index c8ce701..409e296 100644
    --- a/drivers/net/xen-netback/netback.c
    +++ b/drivers/net/xen-netback/netback.c
    @@ -1758,13 +1758,13 @@ static inline void xenvif_tx_dealloc_action(struct xenvif_queue *queue)
    smp_rmb();

    while (dc != dp) {
    - BUG_ON(gop - queue->tx_unmap_ops > MAX_PENDING_REQS);
    + BUG_ON(gop - queue->tx_unmap_ops >= MAX_PENDING_REQS);
    pending_idx =
    queue->dealloc_ring[pending_index(dc++)];

    - pending_idx_release[gop-queue->tx_unmap_ops] =
    + pending_idx_release[gop - queue->tx_unmap_ops] =
    pending_idx;
    - queue->pages_to_unmap[gop-queue->tx_unmap_ops] =
    + queue->pages_to_unmap[gop - queue->tx_unmap_ops] =
    queue->mmap_pages[pending_idx];
    gnttab_set_unmap_op(gop,
    idx_to_kaddr(queue, pending_idx),
    --
    1.9.1


    \
     
     \ /
      Last update: 2015-08-28 01:01    [W:5.123 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site