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)
commitd74c96c10c03025327c5004900d72bfa03bc957b
treed33fc1cc1a41a9cba605d24d744aae4e97be03f7
parent08a23755080f590c577ecedb5a444e55daeb258c
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