Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1756210imm; Sun, 27 May 2018 15:26:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo0xZtUfwsZWURqE1yKjVNIMK6kuzz5zkSLjhoVQrZFOYUgIt/LDneArCL/tFKvJaztdEh0 X-Received: by 2002:a63:735e:: with SMTP id d30-v6mr8447327pgn.257.1527459996571; Sun, 27 May 2018 15:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527459996; cv=none; d=google.com; s=arc-20160816; b=Lf8LpNQNIgVJHRW9aRL5BJBLrOE+ggtb8QkXXYoNAZrG72UH/RlYPzpmbnLV3wyWLS 6n5k7rYBuJ3HYflSaXJk11q7EkI7cAq/j0iE5iOELDKMH2nFRWV3qBr1YrF6cvmI8Pwk T1+Q5G1QhYC9uGIsEokPqRoXDBx3tbIaJv3TtzAjaH9kZIFEYopM7i0/XuqFluOy+y0E aNlqqSBMgb+If8vNA6FmQb7uGUb1leZQe2Mj+KgWaycf5GcHtgdw8SNgbSo/mKNDerlH JpvEpP6YjGEx/5TSIsth5X3wtxg3WOIEixjmkq60BMQWySGSQx4LzlmqgeR9Kvxb8upt cvEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=r4Klb3KjrgITkRsLClDUQiR+tpnWEAsekb9xL+vR9X4=; b=i8XeK7V5cGyqRltvgYQIw/DxLfkrxYgUhdwpdQSoP6LOAnhHol1xb1XWA5cXVfbfQW +KijkbzDzH+nxkkZ6PqnYkQapmO/88N+aCtjEtL3gifUIBPS5FJhKjjSyKYJiG27YqcF QE3NXUngpC/kOcYu2F83kfOgr2jVtrAed2PADeM01kcjlGpzRVmvIplmfd9LkqhaX4ms 3Ya4FEpotISRcZsr7hNa4IDd3w/Whi3z+PXQHTMNEnsTdnCxpqLLrBTITOScPHvlr+QW CstztAyYo9Z3I9gpI/Ts8N6lR2bCXyiGLJj9sBtbxp2aMo5WmsHnuHSAkajAJleHOkfE DYfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h134-v6si30004720pfe.52.2018.05.27.15.26.21; Sun, 27 May 2018 15:26:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752231AbeE0WZP (ORCPT + 99 others); Sun, 27 May 2018 18:25:15 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:42405 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582AbeE0WZO (ORCPT ); Sun, 27 May 2018 18:25:14 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fN46C-0005Uh-OT; Sun, 27 May 2018 22:25:12 +0000 From: Colin King To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] dm writecache: fix missing goto in error handling code Date: Sun, 27 May 2018 23:25:12 +0100 Message-Id: <20180527222512.25280-1-colin.king@canonical.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Currently, the -EFBIG error condition when n_bitmaps_bits is too large is falling through to the next statement and the error assignment to r is potentially being ignored. The code should be exiting to the error path via label 'bad'. Fix this by adding the missing goto statement. Detected by CoverityScan, CID#1469377 ("Unused value") Fixes: bb15b431d650 ("dm: add writecache target") Signed-off-by: Colin Ian King --- drivers/md/dm-writecache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 1ef06e738eb6..e61704b6eae1 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -2077,6 +2077,7 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv) if (n_bitmap_bits > 1U << 31) { r = -EFBIG; ti->error = "Invalid device size"; + goto bad; } wc->memory_map = vmalloc(n_metadata_blocks << wc->block_size_bits); -- 2.17.0