Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941417AbcJXTQA (ORCPT ); Mon, 24 Oct 2016 15:16:00 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:41488 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941468AbcJXTPU (ORCPT ); Mon, 24 Oct 2016 15:15:20 -0400 From: "John W. Linville" To: nbd-general@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org, "John W. Linville" , Josef Bacik , Jens Axboe , Markus Pargmann Subject: [PATCH] nbd: fix incorrect unlock of nbd->sock_lock in sock_shutdown Date: Mon, 24 Oct 2016 15:13:25 -0400 Message-Id: <1477336405-28442-1-git-send-email-linville@tuxdriver.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 963 Lines: 33 Commit 0eadf37afc250 ("nbd: allow block mq to deal with timeouts") changed normal usage of nbd->sock_lock to use spin_lock/spin_unlock rather than the *_irq variants, but it missed this unlock in an error path. Found by Coverity, CID 1373871. Signed-off-by: John W. Linville Cc: Josef Bacik Cc: Jens Axboe Cc: Markus Pargmann Fixes: 0eadf37afc250 ("nbd: allow block mq to deal with timeouts") --- By inspection (i.e. compile tested only)... drivers/block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index ba405b55329f..19a16b2dbb91 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -164,7 +164,7 @@ static void sock_shutdown(struct nbd_device *nbd) spin_lock(&nbd->sock_lock); if (!nbd->sock) { - spin_unlock_irq(&nbd->sock_lock); + spin_unlock(&nbd->sock_lock); return; } -- 2.7.4