This is a note to let you know that I've just added the patch titled net: hwbm: Fix unbalanced spinlock in error case to the 4.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-hwbm-fix-unbalanced-spinlock-in-error-case.patch and it can be found in the queue-4.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Fri Jun 17 08:34:39 PDT 2016 From: Gregory CLEMENT <gregory.clement@xxxxxxxxxxxxxxxxxx> Date: Tue, 24 May 2016 18:03:26 +0200 Subject: net: hwbm: Fix unbalanced spinlock in error case From: Gregory CLEMENT <gregory.clement@xxxxxxxxxxxxxxxxxx> [ Upstream commit b388fc7405e901c7d6f7817d05193c054e761815 ] When hwbm_pool_add exited in error the spinlock was not released. This patch fixes this issue. Fixes: 8cb2d8bf57e6 ("net: add a hardware buffer management helper API") Reported-by: Jean-Jacques Hiblot <jjhiblot@xxxxxxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Gregory CLEMENT <gregory.clement@xxxxxxxxxxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/core/hwbm.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/core/hwbm.c +++ b/net/core/hwbm.c @@ -55,18 +55,21 @@ int hwbm_pool_add(struct hwbm_pool *bm_p 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; } Patches currently in stable-queue which might be from gregory.clement@xxxxxxxxxxxxxxxxxx are queue-4.6/net-hwbm-fix-unbalanced-spinlock-in-error-case.patch queue-4.6/net-mvneta-fix-lacking-spinlock-initialization.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html