diff --git a/fs/afs/netdevices.c b/fs/afs/netdevices.c
index 49f189423063d6c760a35f5e2e63bf188cf2bd48..7ad36506c256a55d54fc96dc6e3c323e82c4c230 100644
--- a/fs/afs/netdevices.c
+++ b/fs/afs/netdevices.c
@@ -20,8 +20,7 @@ int afs_get_MAC_address(u8 *mac, size_t maclen)
 	struct net_device *dev;
 	int ret = -ENODEV;
 
-	if (maclen != ETH_ALEN)
-		BUG();
+	BUG_ON(maclen != ETH_ALEN);
 
 	rtnl_lock();
 	dev = __dev_getfirstbyhwtype(&init_net, ARPHRD_ETHER);