diff mbox series

scsi: qedf: Replace kmalloc_array() with kcalloc()

Message ID 20250202213239.49065-1-jiashengjiangcool@gmail.com (mailing list archive)
State Superseded
Headers show
Series scsi: qedf: Replace kmalloc_array() with kcalloc() | expand

Commit Message

Jiasheng Jiang Feb. 2, 2025, 9:32 p.m. UTC
Replace kmalloc_array() with kcalloc() to avoid old (dirty) data being
used/freed.

Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
 drivers/scsi/qedf/qedf_io.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Markus Elfring Feb. 3, 2025, 7:20 a.m. UTC | #1
> Replace kmalloc_array() with kcalloc() to avoid old (dirty) data being
> used/freed.…
> ---
>  drivers/scsi/qedf/qedf_io.c | 4 +---
…

Will you become more familiar with patch version descriptions?
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#n310

Regards,
Markus
Jiasheng Jiang Feb. 4, 2025, 2:52 a.m. UTC | #2
Hi Markus,

On Mon, Feb 3, 2025 at 2:20 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> > Replace kmalloc_array() with kcalloc() to avoid old (dirty) data being
> > used/freed.…
> > ---
> >  drivers/scsi/qedf/qedf_io.c | 4 +---
> …
>
> Will you become more familiar with patch version descriptions?
> 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#n310
>
> Regards,
> Markus

Thanks, I have submitted a v3 and added the changelog.

-Jiasheng
Markus Elfring Feb. 4, 2025, 8:05 a.m. UTC | #3
> Thanks, I have submitted a v3 and added the changelog.
Are you going to improve your version management?
Would a small patch series have been helpful to avoid any confusion here?

Regards,
Markus
Jiasheng Jiang Feb. 5, 2025, 1:08 a.m. UTC | #4
Hi Markus,

On Tue, Feb 4, 2025 at 3:05 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> > Thanks, I have submitted a v3 and added the changelog.
> Are you going to improve your version management?
> Would a small patch series have been helpful to avoid any confusion here?
>
> Regards,
> Markus

Thanks, I have submitted the patch series.

-Jiasheng
Markus Elfring Feb. 5, 2025, 8:11 a.m. UTC | #5
> Thanks, I have submitted the patch series.
* Would a cover letter have been helpful?

* Why did you find a “RESEND” relevant already?

* Is there a need to increase version numbers?


Regards,
Markus
diff mbox series

Patch

diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c
index fcfc3bed02c6..d52057b97a4f 100644
--- a/drivers/scsi/qedf/qedf_io.c
+++ b/drivers/scsi/qedf/qedf_io.c
@@ -254,9 +254,7 @@  struct qedf_cmd_mgr *qedf_cmd_mgr_alloc(struct qedf_ctx *qedf)
 	}
 
 	/* Allocate pool of io_bdts - one for each qedf_ioreq */
-	cmgr->io_bdt_pool = kmalloc_array(num_ios, sizeof(struct io_bdt *),
-	    GFP_KERNEL);
-
+	cmgr->io_bdt_pool = kcalloc(num_ios, sizeof(*cmgr->io_bdt_pool), GFP_KERNEL);
 	if (!cmgr->io_bdt_pool) {
 		QEDF_WARN(&(qedf->dbg_ctx), "Failed to alloc io_bdt_pool.\n");
 		goto mem_err;