[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202312150759.RDeuSwNA-lkp@intel.com>
Date: Fri, 15 Dec 2023 07:48:26 +0800
From: kernel test robot <lkp@...el.com>
To: Lewis Huang <lewis.huang@....com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Alex Deucher <alexander.deucher@....com>,
Nicholas Kazlauskas <nicholas.kazlauskas@....com>
Subject: drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c:532:62-63: WARNING
comparing pointer to 0
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c7402612e2e61b76177f22e6e7f705adcbecc6fe
commit: 5911d02cac70d7fb52009fbd37423e63f8f6f9bc drm/amd/display: Change the DMCUB mailbox memory location from FB to inbox
date: 4 weeks ago
config: x86_64-randconfig-104-20231214 (https://download.01.org/0day-ci/archive/20231215/202312150759.RDeuSwNA-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231215/202312150759.RDeuSwNA-lkp@intel.com/reproduce)
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/202312150759.RDeuSwNA-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c:532:62-63: WARNING comparing pointer to 0
vim +532 drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
505
506 enum dmub_status dmub_srv_calc_mem_info(struct dmub_srv *dmub,
507 const struct dmub_srv_memory_params *params,
508 struct dmub_srv_fb_info *out)
509 {
510 uint8_t *cpu_base;
511 uint64_t gpu_base;
512 uint32_t i;
513
514 if (!dmub->sw_init)
515 return DMUB_STATUS_INVALID;
516
517 memset(out, 0, sizeof(*out));
518
519 if (params->region_info->num_regions != DMUB_NUM_WINDOWS)
520 return DMUB_STATUS_INVALID;
521
522 cpu_base = (uint8_t *)params->cpu_fb_addr;
523 gpu_base = params->gpu_fb_addr;
524
525 for (i = 0; i < DMUB_NUM_WINDOWS; ++i) {
526 const struct dmub_region *reg =
527 ¶ms->region_info->regions[i];
528
529 out->fb[i].cpu_addr = cpu_base + reg->base;
530 out->fb[i].gpu_addr = gpu_base + reg->base;
531
> 532 if (i == DMUB_WINDOW_4_MAILBOX && params->cpu_inbox_addr != 0) {
533 out->fb[i].cpu_addr = (uint8_t *)params->cpu_inbox_addr + reg->base;
534 out->fb[i].gpu_addr = params->gpu_inbox_addr + reg->base;
535 }
536
537 out->fb[i].size = reg->top - reg->base;
538 }
539
540 out->num_fb = DMUB_NUM_WINDOWS;
541
542 return DMUB_STATUS_OK;
543 }
544
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists