From cbc8d507d0b97c95f6625ab08844d52c2a63cb92 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Thu, 19 May 2022 16:57:06 +0000 Subject: [PATCH] virtio: Remove default case from fmt() function The default case can't call format! with the unexpected type because it will end up back in fmt until the stack overflows. BUG=b:232259781 TEST=build and boot Cuttlefish in aosp which uses the unhandled type Change-Id: I80d9b745cf78859bc7e7e939fcc5f9955507241c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3655281 Reviewed-by: Daniel Verkamp Tested-by: kokoro Reviewed-by: Steven Moreland Commit-Queue: Devin Moore --- devices/src/virtio/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/src/virtio/mod.rs b/devices/src/virtio/mod.rs index b7105351b8..70289e5e00 100644 --- a/devices/src/virtio/mod.rs +++ b/devices/src/virtio/mod.rs @@ -134,7 +134,7 @@ impl std::fmt::Display for DeviceType { DeviceType::Tpm => write!(f, "tpm"), DeviceType::VideoDec => write!(f, "video-decoder"), DeviceType::VideoEnc => write!(f, "video-encoder"), - t => write!(f, "unknown-{}", t), + DeviceType::Mac80211HwSim => write!(f, "mac-80211-hw-sim"), } } }