Skip to content

Commit

Permalink
usb: f_fs: replace BUG in dead-code with less serious WARN_ON
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michal Nazarewicz authored and Felipe Balbi committed Sep 11, 2014
1 parent c559a35 commit fe00bcb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/gadget/function/f_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

{
Expand Down

0 comments on commit fe00bcb

Please sign in to comment.