From: Michal Nazarewicz Date: Thu, 11 Sep 2014 16:52:49 +0000 (+0200) Subject: usb: f_fs: replace BUG in dead-code with less serious WARN_ON X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fe00bcbf8a124980a38ce395ed6422d41be17374;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usb: f_fs: replace BUG in dead-code with less serious WARN_ON Even though the BUG() in __ffs_event_add is a dead-code, it is still better to warn rather then crash the system if that code ever gets executed. Reported-by: Felipe Balbi Signed-off-by: Michal Nazarewicz Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index a345385a5abe..a86b0a231a8c 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -2337,7 +2337,8 @@ static void __ffs_event_add(struct ffs_data *ffs, break; default: - BUG(); + WARN(1, "%d: unknown event, this should not happen\n", type); + return; } {