All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/infiniband/hw/irdma/pble.c:419 get_lvl1_pble() warn: should 'palloc->total_cnt << 3' be a 64 bit type?
Date: Wed, 10 Nov 2021 07:26:28 +0800	[thread overview]
Message-ID: <202111100717.MppQtrD8-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3548 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Shiraz Saleem <shiraz.saleem@intel.com>
CC: Jason Gunthorpe <jgg@nvidia.com>
CC: Tatyana Nikolova <tatyana.e.nikolova@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cb690f5238d71f543f4ce874aa59237cf53a877c
commit: 1f700757224effe598690b34e95329aff4e3e362 RDMA/irdma: Fix potential overflow expression in irdma_prm_get_pbles
date:   5 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-m031-20211014 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/infiniband/hw/irdma/pble.c:419 get_lvl1_pble() warn: should 'palloc->total_cnt << 3' be a 64 bit type?

Old smatch warnings:
drivers/infiniband/hw/irdma/pble.c:112 add_sd_direct() warn: should 'info->pages << 12' be a 64 bit type?

vim +419 drivers/infiniband/hw/irdma/pble.c

e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  404  
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  405  /**
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  406   * get_lvl1_pble - get level 1 pble resource
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  407   * @pble_rsrc: pble resource management
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  408   * @palloc: level 1 pble allocation
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  409   */
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  410  static enum irdma_status_code
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  411  get_lvl1_pble(struct irdma_hmc_pble_rsrc *pble_rsrc,
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  412  	      struct irdma_pble_alloc *palloc)
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  413  {
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  414  	enum irdma_status_code ret_code;
2db7b2eac7ad55 Shiraz Saleem  2021-06-09  415  	u64 fpm_addr;
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  416  	struct irdma_pble_info *lvl1 = &palloc->level1;
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  417  
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  418  	ret_code = irdma_prm_get_pbles(&pble_rsrc->pinfo, &lvl1->chunkinfo,
2db7b2eac7ad55 Shiraz Saleem  2021-06-09 @419  				       palloc->total_cnt << 3, &lvl1->addr,
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  420  				       &fpm_addr);
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  421  	if (ret_code)
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  422  		return IRDMA_ERR_NO_MEMORY;
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  423  
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  424  	palloc->level = PBLE_LEVEL_1;
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  425  	lvl1->idx = fpm_to_idx(pble_rsrc, fpm_addr);
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  426  	lvl1->cnt = palloc->total_cnt;
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  427  	pble_rsrc->stats_lvl1++;
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  428  
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  429  	return 0;
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  430  }
e8c4dbc2fcacf5 Mustafa Ismail 2021-06-02  431  

:::::: The code at line 419 was first introduced by commit
:::::: 2db7b2eac7ad55105fe037b3f8f57d8ecac8c3fb RDMA/irdma: Store PBL info address a pointer type

:::::: TO: Shiraz Saleem <shiraz.saleem@intel.com>
:::::: CC: Jason Gunthorpe <jgg@nvidia.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 43740 bytes --]

                 reply	other threads:[~2021-11-09 23:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202111100717.MppQtrD8-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.