From: Dan Carpenter Date: Sat, 10 Jul 2010 08:53:38 +0000 (+0200) Subject: prism54: call BUG_ON() earlier X-Git-Tag: MMI-PSA29.97-13-9~23092^2~107^2~70 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4c92831d99827971cf2854cfa7f884213099428f;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git prism54: call BUG_ON() earlier This test is off by one because strlen() doesn't include the NULL terminator. Signed-off-by: Dan Carpenter Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index 236e37526d07..2e656bb7e14e 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c @@ -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);