Skip to content

Commit

Permalink
prism54: call BUG_ON() earlier
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and John W. Linville committed Jul 12, 2010
1 parent 72e93e9 commit 4c92831
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/prism54/isl_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4c92831

Please sign in to comment.