I just tried out cppcheck-1.52 on the linux-3.3-rc1 source code. It said [drivers/dma/iop-adma.c:1359]: (error) Buffer access out-of-bounds: pq_src [drivers/dma/iop-adma.c:1391]: (error) Buffer access out-of-bounds: pq_src The source code is for (i = 0; i < IOP_ADMA_NUM_SRC_TEST + 2; i++) pq_src[i] = dma_map_page(dev, pq[i], 0, PAGE_SIZE, DMA_TO_DEVICE); So arrays pq_src and pq have to have the same number of elements. But struct page *pq[IOP_ADMA_NUM_SRC_TEST+2+2]; and dma_addr_t pq_src[IOP_ADMA_NUM_SRC_TEST]; so pq has four more elements in it. Suggest code rework.
A patch referencing this bug report has been merged in Linux v3.4-rc3: commit 3d9ea9e3af048ab6b8dced15248384e548ba05ea Author: Don Morris <don.morris@hp.com> Date: Thu Mar 15 11:07:30 2012 -0700 iop-adma: Corrected array overflow in RAID6 Xscale(R) test.