[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202506240340.fv6cXpyc-lkp@intel.com>
Date: Tue, 24 Jun 2025 03:36:23 +0800
From: kernel test robot <lkp@...el.com>
To: jackysliu <1972843537@...com>, skashyap@...vell.com
Cc: oe-kbuild-all@...ts.linux.dev, jhasan@...vell.com,
GR-QLogic-Storage-Upstream@...vell.com,
James.Bottomley@...senpartnership.com, martin.petersen@...cle.com,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
jackysliu <1972843537@...com>
Subject: Re: [PATCH] scsi: qedf: Fix a possible memory leak in
qedf_prepare_sb()
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@...el.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
Powered by blists - more mailing lists