mbox series

[0/2] scsi: qedf: Replace alloction API and add null check

Message ID 20250206052523.16683-1-jiashengjiangcool@gmail.com
Headers show
Series scsi: qedf: Replace alloction API and add null check | expand

Message

Jiasheng Jiang Feb. 6, 2025, 5:25 a.m. UTC
This patch series improves memory safety in the qedf SCSI driver by:

1. Replace kmalloc_array() with kcalloc() to avoid old (dirty) data being
   used/freed.
2. Add a check for "bdt_info". Otherwise, if one of the allocations
   for "cmgr->io_bdt_pool[i]" fails, "bdt_info->bd_tbl" will cause a NULL
   pointer dereference.

### Changelog:
#### v2:
- Replace kzalloc() with kcalloc().

Jiasheng Jiang (2):
  scsi: qedf: Replace kmalloc_array() with kcalloc()
  scsi: qedf: Add check for bdt_info

 drivers/scsi/qedf/qedf_io.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)