summaryrefslogtreecommitdiff
path: root/net/core/hwbm.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-06-09 11:01:49 +1000
committerDave Airlie <airlied@redhat.com>2016-06-09 11:01:49 +1000
commitfa625c1956830c826ebf13324c2b33fcabef7db0 (patch)
tree92c7f1272617c5c6a82478ba161af97eae0260cd /net/core/hwbm.c
parent66fd7a66e8b9e11e49f46ea77910f935c4dee5c3 (diff)
parentaf8c34ce6ae32addda3788d54a7e340cad22516b (diff)
Backmerge tag 'v4.7-rc2' into drm-next
Daniel has a pull request that relies on stuff in fixes that are in rc2.
Diffstat (limited to 'net/core/hwbm.c')
-rw-r--r--net/core/hwbm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/hwbm.c b/net/core/hwbm.c
index 941c28486896..2cab489ae62e 100644
--- a/net/core/hwbm.c
+++ b/net/core/hwbm.c
@@ -55,18 +55,21 @@ int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num, gfp_t gfp)
spin_lock_irqsave(&bm_pool->lock, flags);
if (bm_pool->buf_num == bm_pool->size) {
pr_warn("pool already filled\n");
+ spin_unlock_irqrestore(&bm_pool->lock, flags);
return bm_pool->buf_num;
}
if (buf_num + bm_pool->buf_num > bm_pool->size) {
pr_warn("cannot allocate %d buffers for pool\n",
buf_num);
+ spin_unlock_irqrestore(&bm_pool->lock, flags);
return 0;
}
if ((buf_num + bm_pool->buf_num) < bm_pool->buf_num) {
pr_warn("Adding %d buffers to the %d current buffers will overflow\n",
buf_num, bm_pool->buf_num);
+ spin_unlock_irqrestore(&bm_pool->lock, flags);
return 0;
}