]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: fix off-by-one in incrementing read pointer
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 10 Oct 2014 17:51:52 +0000 (10:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Oct 2014 19:39:15 +0000 (15:39 -0400)
commit71f3a3bd81bfe31211663b5d59aed89ec323ec2c
treea8523979b784a4f0a9131fec2cf8ad56cf356f0f
parent46cdb7336804b8401b6f232c1efd4d9214f2eb42
net: bcmgenet: fix off-by-one in incrementing read pointer

Commit 6decaaa090eb74cff1334cbc812fa22e03829dc2 ("net: bcmgenet: check
harder for out of memory conditions") moved the increment of the local
read pointer *before* reading from the hardware descriptor using
dmadesc_get_length_status(), which creates an off-by-one situation.

Fix this by moving again the read_ptr increment after we have read the
hardware descriptor to get both the control block and the read pointer
back in sync.

Fixes: 6decaaa090eb ("net: bcmgenet: check harder for out of memory conditions")
Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Petri Gynther <pgynther@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c