ath(4) error: array index 21 is past the end of the array (which contains, 21 elements)

Sevan / Venture37 venture37 at gmail.com
Sat Aug 25 18:45:34 UTC 2012


Hi,
On -CURRENT buildkernel fails when WITH_CLANG_IS_CC declared with:

/usr/src/sys/modules/ath/../../dev/ath/if_ath_debug.c:184:24: error: 
array index 21 is past the end of the array (which contains
  21 elements) [-Werror,-Warray-bounds]
			    eds->ds_hw[20], eds->ds_hw[21]);
					    ^          ~~
@/dev/ath/ath_hal/ah_desc.h:229:2: note: array 'ds_hw' declared here
	uint32_t        ds_hw[21];      /* includes buf/len */
	^
1 error generated.
*** [if_ath_debug.o] Error code 1


Attached patch bumps array size to 22 in decleration which stops the error.


Sevan
-------------- next part --------------
Index: sys/dev/ath/ath_hal/ah_desc.h
===================================================================
--- sys/dev/ath/ath_hal/ah_desc.h	(revision 239685)
+++ sys/dev/ath/ath_hal/ah_desc.h	(working copy)
@@ -226,7 +226,7 @@
 struct ath_desc_txedma {
 	uint32_t	ds_info;
 	uint32_t	ds_link;
-	uint32_t	ds_hw[21];	/* includes buf/len */
+	uint32_t	ds_hw[22];	/* includes buf/len */
 };
 
 struct ath_desc_status {


More information about the freebsd-wireless mailing list