]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvpp2: Fix the BM pool buffer release check
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Mon, 21 Jul 2014 16:48:13 +0000 (13:48 -0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jul 2014 02:50:30 +0000 (19:50 -0700)
commitdacd61fd8d248c124c5bbd8f56c031170b8c1455
treed33fc1cc1a41a9cba605d24d744aae4e97be03f7
parent8aac8e8c281e7b4072836e3ade7d76bba0ed4b9d
net: mvpp2: Fix the BM pool buffer release check

After a call to mvpp2_bm_bufs_free(), the caller usually wants to know
if the function successfully freed the requested number. However, this
cannot be done by looking into the BM pool count, because the current
buffer count was updated by mvpp2_bm_bufs_free().

In fact, the current callers of mvpp2_bm_bufs_free() use it to release
all the buffers in the pool, so we can fix this by simply checking
if the pool is not empty.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c