mbox series

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

Message ID 20250206052523.16683-1-jiashengjiangcool@gmail.com (mailing list archive)
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(-)

Comments

Markus Elfring Feb. 6, 2025, 11:56 a.m. UTC | #1
> ### Changelog:
> #### v2:
…

Why did you overlook to increment version numbers once more?
https://lore.kernel.org/all/?q=%22This+looks+like+a+new+version+of+a+previously+submitted+patch%22
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13#n605

Regards,
Markus