prism54: call BUG_ON() earlier
This test is off by one because strlen() doesn't include the NULL terminator. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
72e93e9161
commit
4c92831d99
|
@ -2067,7 +2067,7 @@ send_simple_event(islpci_private *priv, const char *str)
|
|||
memptr = kmalloc(IW_CUSTOM_MAX, GFP_KERNEL);
|
||||
if (!memptr)
|
||||
return;
|
||||
BUG_ON(n > IW_CUSTOM_MAX);
|
||||
BUG_ON(n >= IW_CUSTOM_MAX);
|
||||
wrqu.data.pointer = memptr;
|
||||
wrqu.data.length = n;
|
||||
strcpy(memptr, str);
|
||||
|
|
Loading…
Reference in New Issue