* [patch] Staging: rtl8712: signedness bug in init
@ 2010-11-12 5:11 Dan Carpenter
2010-11-12 13:24 ` Larry Finger
2010-11-12 15:30 ` Dan Carpenter
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-11-12 5:11 UTC (permalink / raw)
To: kernel-janitors
PollingCnt is 20 and that means we loop 20 times and then run the
timeout code. After the end of the loop PollingCnt should be -1 but
because it's an unsigned char, it's actually 255 and the timeout
code never runs.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/staging/rtl8712/usb_halinit.c b/drivers/staging/rtl8712/usb_halinit.c
index f6569dc..0e9483b 100644
--- a/drivers/staging/rtl8712/usb_halinit.c
+++ b/drivers/staging/rtl8712/usb_halinit.c
@@ -37,7 +37,7 @@ u8 r8712_usb_hal_bus_init(struct _adapter *padapter)
{
u8 val8 = 0;
u8 ret = _SUCCESS;
- u8 PollingCnt = 20;
+ int PollingCnt = 20;
struct registry_priv *pregistrypriv = &padapter->registrypriv;
if (pregistrypriv->chip_version = RTL8712_FPGA) {
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [patch] Staging: rtl8712: signedness bug in init
2010-11-12 5:11 [patch] Staging: rtl8712: signedness bug in init Dan Carpenter
@ 2010-11-12 13:24 ` Larry Finger
2010-11-12 15:30 ` Dan Carpenter
1 sibling, 0 replies; 3+ messages in thread
From: Larry Finger @ 2010-11-12 13:24 UTC (permalink / raw)
To: kernel-janitors
On 11/11/2010 11:11 PM, Dan Carpenter wrote:
> PollingCnt is 20 and that means we loop 20 times and then run the
> timeout code. After the end of the loop PollingCnt should be -1 but
> because it's an unsigned char, it's actually 255 and the timeout
> code never runs.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
As a point of interest, did you actually hit a timeout, or was this found by a
code audit?
Larry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] Staging: rtl8712: signedness bug in init
2010-11-12 5:11 [patch] Staging: rtl8712: signedness bug in init Dan Carpenter
2010-11-12 13:24 ` Larry Finger
@ 2010-11-12 15:30 ` Dan Carpenter
1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-11-12 15:30 UTC (permalink / raw)
To: kernel-janitors
On Fri, Nov 12, 2010 at 07:24:24AM -0600, Larry Finger wrote:
> On 11/11/2010 11:11 PM, Dan Carpenter wrote:
> > PollingCnt is 20 and that means we loop 20 times and then run the
> > timeout code. After the end of the loop PollingCnt should be -1 but
> > because it's an unsigned char, it's actually 255 and the timeout
> > code never runs.
> >
> > Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
>
> As a point of interest, did you actually hit a timeout, or was this found by a
> code audit?
This was a static check thing. (http://smatch.sf.net)
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-12 15:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-12 5:11 [patch] Staging: rtl8712: signedness bug in init Dan Carpenter
2010-11-12 13:24 ` Larry Finger
2010-11-12 15:30 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).