* drivers/infiniband/hw/irdma/pble.c:419 get_lvl1_pble() warn: should 'palloc->total_cnt << 3' be a 64 bit type?
@ 2021-11-09 23:26 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-11-09 23:26 UTC (permalink / raw)
To: kbuild
[-- 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 --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-09 23:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-09 23:26 drivers/infiniband/hw/irdma/pble.c:419 get_lvl1_pble() warn: should 'palloc->total_cnt << 3' be a 64 bit type? kernel test robot
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.