Re: [PATCH] scsi: qla2xxx: edif: Fix dma_free_coherent() size

From: Markus Elfring

Date: Mon Jan 12 2026 - 09:13:08 EST


> Earlier in the function, the ha->flt buffer is allocated with size
> sizeof(struct qla_flt_header) + FLT_REGIONS_SIZE but freed in the error
> path with size SFP_DEV_SIZE.

See also once more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.19-rc4#n94


You should probably not only specify message recipients in the header field “Cc”.



> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -4489,7 +4489,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
> fail_elsrej:
> dma_pool_destroy(ha->purex_dma_pool);
> fail_flt:
> - dma_free_coherent(&ha->pdev->dev, SFP_DEV_SIZE,
> + dma_free_coherent(&ha->pdev->dev, sizeof(struct qla_flt_header) + FLT_REGIONS_SIZE,
> ha->flt, ha->flt_dma);


How do you think about to adjust the indentation another bit for the passed parameters?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.19-rc4#n110

Regards,
Markus