Commit bd9a212b authored by Dan Carpenter's avatar Dan Carpenter Committed by Kalle Valo

prism54: off by one BUG_ON() test

This code was supposed to trigger a BUG() if we truncate the output but
it's off by one so it allows one character to be truncated.  Really
drivers shouldn't call BUG_ON() and especially for something minor like
this so I've changed it to a WARN_ON().
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 9e4aee43
...@@ -2036,7 +2036,7 @@ format_event(islpci_private *priv, char *dest, const char *str, ...@@ -2036,7 +2036,7 @@ format_event(islpci_private *priv, char *dest, const char *str,
mlme->address, mlme->address,
(error ? (mlme->code ? " : REJECTED " : " : ACCEPTED ") (error ? (mlme->code ? " : REJECTED " : " : ACCEPTED ")
: ""), mlme->code); : ""), mlme->code);
BUG_ON(n > IW_CUSTOM_MAX); WARN_ON(n >= IW_CUSTOM_MAX);
*length = n; *length = n;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment