]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: calculate pointers from out_cmd instead of out_cmd->hdr
authorLuca Coelho <luciano.coelho@intel.com>
Mon, 5 Nov 2018 13:45:54 +0000 (15:45 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 29 Jan 2019 14:10:30 +0000 (16:10 +0200)
The out_cmd structure starts with a header, so there's no need to use
&out_cmd->hdr, out_cmd alone is enough.  We use this when calculating
other addresses and klocwork gets confused with that because it thinks
we are trying to access hdr (as an array) beyond its size.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c

index 8807ea9d693cab782477a36f679f0e54facda2e3..f3d2e8fe920b23b42a8d52d0209c4a72247d4458 100644 (file)
@@ -838,14 +838,14 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
 
        /* start the TFD with the minimum copy bytes */
        tb0_size = min_t(int, copy_size, IWL_FIRST_TB_SIZE);
-       memcpy(&txq->first_tb_bufs[idx], &out_cmd->hdr, tb0_size);
+       memcpy(&txq->first_tb_bufs[idx], out_cmd, tb0_size);
        iwl_pcie_gen2_set_tb(trans, tfd, iwl_pcie_get_first_tb_dma(txq, idx),
                             tb0_size);
 
        /* map first command fragment, if any remains */
        if (copy_size > tb0_size) {
                phys_addr = dma_map_single(trans->dev,
-                                          ((u8 *)&out_cmd->hdr) + tb0_size,
+                                          (u8 *)out_cmd + tb0_size,
                                           copy_size - tb0_size,
                                           DMA_TO_DEVICE);
                if (dma_mapping_error(trans->dev, phys_addr)) {