Linux-RDMA Archive on lore.kernel.org
 help / color / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: faisal.latif@intel.com
Cc: linux-rdma@vger.kernel.org
Subject: [bug report] i40iw: add pble resource files
Date: Tue, 13 Apr 2021 13:52:56 +0300
Message-ID: <YHV4CFXzqTm23AOZ@mwanda> (raw)

Hello Faisal Latif,

The patch 9715830157be: "i40iw: add pble resource files" from Jan 20,
2016, leads to the following static checker warning:

	drivers/infiniband/hw/i40iw/i40iw_pble.c:414 add_pble_pool()
	warn: '&chunk->list' not removed from list

drivers/infiniband/hw/i40iw/i40iw_pble.c
   391          }
   392          pble_rsrc->next_fpm_addr += chunk->size;
   393          i40iw_debug(dev, I40IW_DEBUG_PBLE, "next_fpm_addr = %llx chunk_size[%u] = 0x%x\n",
   394                      pble_rsrc->next_fpm_addr, chunk->size, chunk->size);
   395          pble_rsrc->unallocated_pble -= (chunk->size >> 3);
   396          list_add(&chunk->list, &pble_rsrc->pinfo.clist);
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"chunk" is added to the list.

   397          sd_reg_val = (sd_entry_type == I40IW_SD_TYPE_PAGED) ?
   398                          sd_entry->u.pd_table.pd_page_addr.pa : sd_entry->u.bp.addr.pa;
   399          if (sd_entry->valid)
   400                  return 0;
   401          if (dev->is_pf) {
   402                  ret_code = i40iw_hmc_sd_one(dev, hmc_info->hmc_fn_id,
   403                                              sd_reg_val, idx->sd_idx,
   404                                              sd_entry->entry_type, true);
   405                  if (ret_code) {
   406                          i40iw_pr_err("cqp cmd failed for sd (pbles)\n");
   407                          goto error;
                                ^^^^^^^^^^
We hit an error

   408                  }
   409          }
   410  
   411          sd_entry->valid = true;
   412          return 0;
   413   error:
   414          kfree(chunk);
                ^^^^^^^^^^^^
"chunk" is freed but it's still on the list

   415          return ret_code;
   416  }

regards,
dan carpenter

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 10:52 Dan Carpenter [this message]
2021-04-14  0:13 ` Saleem, Shiraz

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=YHV4CFXzqTm23AOZ@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=faisal.latif@intel.com \
    --cc=linux-rdma@vger.kernel.org \
    /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

Linux-RDMA Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rdma/0 linux-rdma/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rdma linux-rdma/ https://lore.kernel.org/linux-rdma \
		linux-rdma@vger.kernel.org
	public-inbox-index linux-rdma

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rdma


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git