]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usb: f_fs: replace BUG in dead-code with less serious WARN_ON
authorMichal Nazarewicz <mina86@mina86.com>
Thu, 11 Sep 2014 16:52:49 +0000 (18:52 +0200)
committerFelipe Balbi <balbi@ti.com>
Thu, 11 Sep 2014 17:15:54 +0000 (12:15 -0500)
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 <balbi@ti.com>
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_fs.c

index a345385a5abe2f439ee1556cd7b10d543a770656..a86b0a231a8c42f0c2b68edee7a8c9ec26c6213b 100644 (file)
@@ -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;
        }
 
        {