From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Jake Wang <haonan.wang2@amd.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Alex Deucher <alexander.deucher@amd.com>
Subject: [kbuild] [linux-next:master 12597/13745] drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:222 dcn21_set_backlight_level() error: we previously assumed 'panel_cntl' could be null (see line 213)
Date: Tue, 20 Apr 2021 12:15:08 +0300 [thread overview]
Message-ID: <20210420091508.GF1959@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 3999 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 50b8b1d699ac313c0a07a3c185ffb23aecab8abb
commit: e922057b556d37c54f8f88e44f7d7b731d6365b1 [12597/13745] drm/amd/display: Added support for multiple eDP BL control
config: x86_64-randconfig-m001-20210419 (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>
smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:222 dcn21_set_backlight_level() error: we previously assumed 'panel_cntl' could be null (see line 213)
vim +/panel_cntl +222 drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c
474ac4a875ca6f Yongqiang Sun 2020-04-27 198 bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
474ac4a875ca6f Yongqiang Sun 2020-04-27 199 uint32_t backlight_pwm_u16_16,
474ac4a875ca6f Yongqiang Sun 2020-04-27 200 uint32_t frame_ramp)
474ac4a875ca6f Yongqiang Sun 2020-04-27 201 {
474ac4a875ca6f Yongqiang Sun 2020-04-27 202 union dmub_rb_cmd cmd;
474ac4a875ca6f Yongqiang Sun 2020-04-27 203 struct dc_context *dc = pipe_ctx->stream->ctx;
474ac4a875ca6f Yongqiang Sun 2020-04-27 204 struct abm *abm = pipe_ctx->stream_res.abm;
474ac4a875ca6f Yongqiang Sun 2020-04-27 205 uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;
474ac4a875ca6f Yongqiang Sun 2020-04-27 206 struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
474ac4a875ca6f Yongqiang Sun 2020-04-27 207
474ac4a875ca6f Yongqiang Sun 2020-04-27 208 if (dc->dc->res_pool->dmcu) {
474ac4a875ca6f Yongqiang Sun 2020-04-27 209 dce110_set_backlight_level(pipe_ctx, backlight_pwm_u16_16, frame_ramp);
474ac4a875ca6f Yongqiang Sun 2020-04-27 210 return true;
474ac4a875ca6f Yongqiang Sun 2020-04-27 211 }
474ac4a875ca6f Yongqiang Sun 2020-04-27 212
474ac4a875ca6f Yongqiang Sun 2020-04-27 @213 if (abm && panel_cntl)
^^^^^^^^^^
This code assumed "panel_cntl" can be NULL
474ac4a875ca6f Yongqiang Sun 2020-04-27 214 dmub_abm_set_pipe(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst);
474ac4a875ca6f Yongqiang Sun 2020-04-27 215
148816f93fa0db Wyatt Wood 2021-01-18 216 memset(&cmd, 0, sizeof(cmd));
474ac4a875ca6f Yongqiang Sun 2020-04-27 217 cmd.abm_set_backlight.header.type = DMUB_CMD__ABM;
474ac4a875ca6f Yongqiang Sun 2020-04-27 218 cmd.abm_set_backlight.header.sub_type = DMUB_CMD__ABM_SET_BACKLIGHT;
474ac4a875ca6f Yongqiang Sun 2020-04-27 219 cmd.abm_set_backlight.abm_set_backlight_data.frame_ramp = frame_ramp;
474ac4a875ca6f Yongqiang Sun 2020-04-27 220 cmd.abm_set_backlight.abm_set_backlight_data.backlight_user_level = backlight_pwm_u16_16;
e922057b556d37 Jake Wang 2021-04-01 221 cmd.abm_set_backlight.abm_set_backlight_data.version = DMUB_CMD_ABM_SET_BACKLIGHT_VERSION_1;
e922057b556d37 Jake Wang 2021-04-01 @222 cmd.abm_set_backlight.abm_set_backlight_data.panel_mask = (0x01 << panel_cntl->inst);
^^^^^^^^^^^^^^^^
Unchecked dereference
474ac4a875ca6f Yongqiang Sun 2020-04-27 223 cmd.abm_set_backlight.header.payload_bytes = sizeof(struct dmub_cmd_abm_set_backlight_data);
474ac4a875ca6f Yongqiang Sun 2020-04-27 224
474ac4a875ca6f Yongqiang Sun 2020-04-27 225 dc_dmub_srv_cmd_queue(dc->dmub_srv, &cmd);
474ac4a875ca6f Yongqiang Sun 2020-04-27 226 dc_dmub_srv_cmd_execute(dc->dmub_srv);
474ac4a875ca6f Yongqiang Sun 2020-04-27 227 dc_dmub_srv_wait_idle(dc->dmub_srv);
474ac4a875ca6f Yongqiang Sun 2020-04-27 228
474ac4a875ca6f Yongqiang Sun 2020-04-27 229 return true;
474ac4a875ca6f Yongqiang Sun 2020-04-27 230 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35169 bytes --]
[-- Attachment #3: Type: text/plain, Size: 149 bytes --]
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
reply other threads:[~2021-04-20 9:15 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=20210420091508.GF1959@kadam \
--to=dan.carpenter@oracle.com \
--cc=alexander.deucher@amd.com \
--cc=haonan.wang2@amd.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).