Bug 7752
Summary: | drivers/net/wireless/zd1211rw/zd_chip.c:1461 ASSERT r >= 0 VIOLATED! | ||
---|---|---|---|
Product: | Drivers | Reporter: | Maxime Austruy (maxime) |
Component: | network-wireless | Assignee: | Ulrich Kunitz (kune) |
Status: | REJECTED INSUFFICIENT_DATA | ||
Severity: | normal | CC: | dsd, kune, linville, protasnb, zac.wheeler |
Priority: | P2 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | 2.6.20-rc2-g7479b1ce | Subsystem: | |
Regression: | --- | Bisected commit-id: | |
Attachments: | Patch for debug output |
Description
Maxime Austruy
2006-12-29 20:44:24 UTC
Created attachment 9970 [details]
Patch for debug output
The debugging ASSERT indicates unexpected behaviour, but the case is correctly handled by the code. To find the cause and fix it -- I added a patch, which outputs additional information. The other debug message indicate that the device sends broken packets to the host. This is handled correctly by the driver and doesn't indicate a bug of the driver. Any updates on this problem? Thanks. This appears to still be present in 2.6.28.4. I could very well be wrong, but this looks to me to be caused by the variable 'size' equal to zero being passed to ofdm_qual_db(status_quality, rate, size) which does not check for this condition before it divides by 'size': x = (10000 * status_quality)/size; I avoid the issue (since I am not interested in figuring out what the correct thing is to do with a size of zero, maybe return -EINVAL?) by modifying the calling function so: static int ofdm_qual_percent(u8 status_quality, u8 zd_rate, unsigned int size) { int r = 0; if (size > 0) r = ofdm_qual_db(status_quality, zd_rate, size); ZD_ASSERT(r >= 0); if (r < 0) r = 0; r = (r * 100)/29; return r <= 100 ? r : 100; } |