I'm busy with importing a new clang snapshot into head. This version has a bunch of interesting new warnings, and I got the following one during building of ath: sys/dev/ath/if_ath.c:4337:6: error: variable 'isCalDone' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (shortCal || longCal) { ^~~~~~~~~~~~~~~~~~~ sys/dev/ath/if_ath.c:4354:7: note: uninitialized use occurs here if (!isCalDone) { ^~~~~~~~~ sys/dev/ath/if_ath.c:4337:2: note: remove the 'if' if its condition is always true if (shortCal || longCal) { ^~~~~~~~~~~~~~~~~~~~~~~~~ sys/dev/ath/if_ath.c:4288:2: note: variable 'isCalDone' is declared here HAL_BOOL longCal, isCalDone; ^ It's because isCalDone is never initialized, if shortCal and longCal are both false. In that case, the next test for isCalDone will have an unpredictable result. Looking at the code in the various ar5xxxPerCalibrationN() functions, they only seem to set isCalDone to AH_TRUE in the explicit case calibration succeeded, so initializing isCalDone to AH_FALSE at the start of ath_calibrate() looks like the safest thing to do. Please see the attached patch. Fix: Patch attached with submission follows:
Responsible Changed From-To: freebsd-bugs->freebsd-wireless Over to maintainer(s).
Fixed in r241229.