diff mbox

VFS: fix bugon.cocci warnings

Message ID alpine.DEB.2.20.1705042020280.4880@hadrien (mailing list archive)
State New, archived
Headers show

Commit Message

Julia Lawall May 4, 2017, 6:21 p.m. UTC
Use BUG_ON instead of a if condition followed by BUG.

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

Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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(-)

Comments

David Howells May 4, 2017, 8:06 p.m. UTC | #1
Julia Lawall <julia.lawall@lip6.fr> wrote:

>  Use BUG_ON instead of a if condition followed by BUG.

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

David
diff mbox

Patch

--- a/fs/mount_context.c
+++ b/fs/mount_context.c
@@ -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)