Skip to contentSkip to conversation

VFS: fix bugon.cocci warnings

PATCH In review Julia Lawall 2 participants 2 messages May 4, 2017 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 VFS: fix bugon.cocci warnings

Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci

---

tree:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
mount-context

head:   87bc8f53d9779ac0347cf31c637a3d1a52611680
commit: be6c651c8f022bd739eb5f894a896bcde5834f82 [3/9] VFS: Introduce a

mount context

 mount_context.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/mount_context.c +1 -2
@@ -191,8 +191,7 @@ struct mount_context *__vfs_fsopen(struc
 	struct mount_context *mc;
 	int ret;
 
-	if (fs_type->fsopen && fs_type->mc_size < sizeof(*mc))
-		BUG();
+	BUG_ON(fs_type->fsopen && fs_type->mc_size < sizeof(*mc));
 
 	mc = kzalloc(max_t(size_t, fs_type->mc_size, sizeof(*mc)), GFP_KERNEL);
 	if (!mc)
#1 lore raw
Quoted 1 line · Julia Lawall

Use BUG_ON instead of a if condition followed by BUG.

I've already fixed that, thanks, just not pushed it yet.

David