public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][-next] loop: fix incorrect nesting levels on braces in nested if statements
@ 2017-06-09 15:54 Colin King
  2017-06-09 15:57 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-06-09 15:54 UTC (permalink / raw)
  To: Jens Axboe, Ming Lei, Hannes Reinecke, Omar Sandoval,
	Andrew Morton
  Cc: kernel-janitors, linux-kernel

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][-next] loop: fix incorrect nesting levels on braces in nested if statements
  2017-06-09 15:54 [PATCH][-next] loop: fix incorrect nesting levels on braces in nested if statements Colin King
@ 2017-06-09 15:57 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2017-06-09 15:57 UTC (permalink / raw)
  To: Colin King, Ming Lei, Hannes Reinecke, Omar Sandoval,
	Andrew Morton
  Cc: kernel-janitors, linux-kernel

On 06/09/2017 09:54 AM, Colin King wrote:
> 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")

Already fixed:

http://git.kernel.dk/cgit/linux-block/commit/?h=for-4.13/block&id=b040ad9cf6a169cc000a5324fcada695dfa1f4b3

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-09 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-09 15:54 [PATCH][-next] loop: fix incorrect nesting levels on braces in nested if statements Colin King
2017-06-09 15:57 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox