Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1662574

[PATCH][-next] loop: fix incorrect nesting levels on braces in nested if statements

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Colin King <colin.king@canonical.com>
Newsgroups linux.kernel
Subject [PATCH][-next] loop: fix incorrect nesting levels on braces in nested if statements
Date Fri, 09 Jun 2017 18:00:01 +0200
Message-ID <tQuul-3qu-1@gated-at.bofh.it> (permalink)
X-Original-To Jens Axboe <axboe@fb.com>, Ming Lei <tom.leiming@gmail.com>, Hannes Reinecke <hare@suse.de>, Omar Sandoval <osandov@fb.com>, Andrew Morton <akpm@linux-foundation.org>
X-Mailer git-send-email 2.11.0
MIME-Version 1.0
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 34
Organization linux.* mail to news gateway
X-Original-Cc kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Fri, 9 Jun 2017 16:54:25 +0100
X-Original-Message-ID <20170609155425.21260-1-colin.king@canonical.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1662574

Show key headers only | View raw


From: Colin Ian King <colin.king@canonical.com>

Adding another set of braces clarifies the block and ensures that
both the setting of err and the error exit are executed on the
deepest nested if statement.

Detected by CoverityScan, CID#1440959 ("Nesting level does not
match indentation")

Fixes: f2c6df7dbf9a60 ("loop: support 4k physical blocksize")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/block/loop.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 4d376c10a97a..e288fb30100f 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1147,10 +1147,11 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
 	    ((lo->lo_flags & LO_FLAGS_BLOCKSIZE) &&
 	     lo->lo_logical_blocksize != LO_INFO_BLOCKSIZE(info))) {
 		if (figure_loop_size(lo, info->lo_offset, info->lo_sizelimit,
-				     LO_INFO_BLOCKSIZE(info)))
+				     LO_INFO_BLOCKSIZE(info))) {
 			err = -EFBIG;
 			goto exit;
 		}
+	}
 
 	loop_config_discard(lo);
 
-- 
2.11.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH][-next] loop: fix incorrect nesting levels on braces in nested if statements Colin King <colin.king@canonical.com> - 2017-06-09 18:00 +0200

csiph-web