From: kernel test robot <lkp@intel.com>
To: jackysliu <1972843537@qq.com>, skashyap@marvell.com
Cc: oe-kbuild-all@lists.linux.dev, jhasan@marvell.com,
GR-QLogic-Storage-Upstream@marvell.com,
James.Bottomley@hansenpartnership.com,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, jackysliu <1972843537@qq.com>
Subject: Re: [PATCH] scsi: qedf: Fix a possible memory leak in qedf_prepare_sb()
Date: Tue, 24 Jun 2025 03:36:23 +0800 [thread overview]
Message-ID: <202506240340.fv6cXpyc-lkp@intel.com> (raw)
In-Reply-To: <tencent_3C5078D216712F6F21FC8792FADED59A3D09@qq.com>
Hi jackysliu,
kernel test robot noticed the following build warnings:
[auto build test WARNING on jejb-scsi/for-next]
[also build test WARNING on mkp-scsi/for-next linus/master v6.16-rc3 next-20250623]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/jackysliu/scsi-qedf-Fix-a-possible-memory-leak-in-qedf_prepare_sb/20250617-180032
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
patch link: https://lore.kernel.org/r/tencent_3C5078D216712F6F21FC8792FADED59A3D09%40qq.com
patch subject: [PATCH] scsi: qedf: Fix a possible memory leak in qedf_prepare_sb()
config: i386-randconfig-141-20250623 (https://download.01.org/0day-ci/archive/20250624/202506240340.fv6cXpyc-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506240340.fv6cXpyc-lkp@intel.com/
New smatch warnings:
drivers/scsi/qedf/qedf_main.c:2814 qedf_prepare_sb() warn: inconsistent indenting
Old smatch warnings:
drivers/scsi/qedf/qedf_main.c:2816 qedf_prepare_sb() warn: inconsistent indenting
vim +2814 drivers/scsi/qedf/qedf_main.c
2773
2774 static int qedf_prepare_sb(struct qedf_ctx *qedf)
2775 {
2776 int id;
2777 struct qedf_fastpath *fp;
2778 int ret;
2779
2780 qedf->fp_array =
2781 kcalloc(qedf->num_queues, sizeof(struct qedf_fastpath),
2782 GFP_KERNEL);
2783
2784 if (!qedf->fp_array) {
2785 QEDF_ERR(&(qedf->dbg_ctx), "fastpath array allocation "
2786 "failed.\n");
2787 return -ENOMEM;
2788 }
2789
2790 for (id = 0; id < qedf->num_queues; id++) {
2791 fp = &(qedf->fp_array[id]);
2792 fp->sb_id = QEDF_SB_ID_NULL;
2793 fp->sb_info = kcalloc(1, sizeof(*fp->sb_info), GFP_KERNEL);
2794 if (!fp->sb_info) {
2795 QEDF_ERR(&(qedf->dbg_ctx), "SB info struct "
2796 "allocation failed.\n");
2797 goto err;
2798 }
2799 ret = qedf_alloc_and_init_sb(qedf, fp->sb_info, id);
2800 if (ret) {
2801 QEDF_ERR(&(qedf->dbg_ctx), "SB allocation and "
2802 "initialization failed.\n");
2803 goto err;
2804 }
2805 fp->sb_id = id;
2806 fp->qedf = qedf;
2807 fp->cq_num_entries =
2808 qedf->global_queues[id]->cq_mem_size /
2809 sizeof(struct fcoe_cqe);
2810 }
2811 err:
2812 for (int i = 0; i < id; i++) {
2813 fp = &qedf->fp_array[i];
> 2814 if (fp->sb_info) {
2815 qedf_free_sb(qedf, fp->sb_info);
2816 kfree(fp->sb_info);
2817 fp->sb_info = NULL;
2818 }
2819 }
2820 kfree(qedf->fp_array);
2821 qedf->fp_array = NULL;
2822 return -ENOMEM;
2823 }
2824
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-06-23 19:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 9:55 [PATCH] scsi: qedf: Fix a possible memory leak in qedf_prepare_sb() jackysliu
2025-06-23 19:36 ` kernel test robot [this message]
2025-06-24 3:16 ` [PATCH] [PATCH] scsi: qedf: fix inconsistent indenting warning Fix below inconsistent indenting smatch warning. New smatch warnings: drivers/scsi/qedf/qedf_main.c:2814 qedf_prepare_sb() warn: inconsistent indenting jackysliu
2025-06-24 3:19 ` [PATCH] scsi: qedf: fix inconsistent indenting warning jackysliu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202506240340.fv6cXpyc-lkp@intel.com \
--to=lkp@intel.com \
--cc=1972843537@qq.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=jhasan@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=skashyap@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox