mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Wenjing Liu <wenjing.liu@amd.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Jun Lei <Jun.Lei@amd.com>
Subject: drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c:384 construct_phy() warn: variable dereferenced before check 'link->link_enc' (see line 381)
Date: Mon, 22 May 2023 09:47:36 +0300	[thread overview]
Message-ID: <aa1f09b5-4e29-48af-8b97-831115a7b682@kili.mountain> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d635f6cc934bcd467c5d67148ece74632fd96abf
commit: 76f5dc40ebb188b081e03783541856c03e97f8e0 drm/amd/display: move dc_link functions in link root folder to dc_link_exports
config: ia64-randconfig-m041-20230514
compiler: ia64-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202305201930.FVPVEaPp-lkp@intel.com/

smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c:384 construct_phy() warn: variable dereferenced before check 'link->link_enc' (see line 381)

vim +384 drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c

54618888d1ea7a Wenjing Liu    2023-01-18  367  	enc_init_data.ctx = dc_ctx;
54618888d1ea7a Wenjing Liu    2023-01-18  368  	bp_funcs->get_src_obj(dc_ctx->dc_bios, link->link_id, 0,
54618888d1ea7a Wenjing Liu    2023-01-18  369  			      &enc_init_data.encoder);
54618888d1ea7a Wenjing Liu    2023-01-18  370  	enc_init_data.connector = link->link_id;
54618888d1ea7a Wenjing Liu    2023-01-18  371  	enc_init_data.channel = get_ddc_line(link);
54618888d1ea7a Wenjing Liu    2023-01-18  372  	enc_init_data.hpd_source = get_hpd_line(link);
54618888d1ea7a Wenjing Liu    2023-01-18  373  
54618888d1ea7a Wenjing Liu    2023-01-18  374  	link->hpd_src = enc_init_data.hpd_source;
54618888d1ea7a Wenjing Liu    2023-01-18  375  
54618888d1ea7a Wenjing Liu    2023-01-18  376  	enc_init_data.transmitter =
54618888d1ea7a Wenjing Liu    2023-01-18  377  		translate_encoder_to_transmitter(enc_init_data.encoder);
54618888d1ea7a Wenjing Liu    2023-01-18  378  	link->link_enc =
54618888d1ea7a Wenjing Liu    2023-01-18  379  		link->dc->res_pool->funcs->link_enc_create(dc_ctx, &enc_init_data);
54618888d1ea7a Wenjing Liu    2023-01-18  380  
54618888d1ea7a Wenjing Liu    2023-01-18 @381  	DC_LOG_DC("BIOS object table - DP_IS_USB_C: %d", link->link_enc->features.flags.bits.DP_IS_USB_C);
                                                                                                 ^^^^^^^^^^^^^^^^
Dereference

54618888d1ea7a Wenjing Liu    2023-01-18  382  	DC_LOG_DC("BIOS object table - IS_DP2_CAPABLE: %d", link->link_enc->features.flags.bits.IS_DP2_CAPABLE);
                                                                                                    ^^^^^^^^^^^^^^^^
Here too.

54618888d1ea7a Wenjing Liu    2023-01-18  383  
54618888d1ea7a Wenjing Liu    2023-01-18 @384  	if (!link->link_enc) {
                                                     ^^^^^^^^^^^^^^
NULL checked too late.


54618888d1ea7a Wenjing Liu    2023-01-18  385  		DC_ERROR("Failed to create link encoder!\n");
54618888d1ea7a Wenjing Liu    2023-01-18  386  		goto link_enc_create_fail;
54618888d1ea7a Wenjing Liu    2023-01-18  387  	}
54618888d1ea7a Wenjing Liu    2023-01-18  388  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


                 reply	other threads:[~2023-05-22  6:52 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=aa1f09b5-4e29-48af-8b97-831115a7b682@kili.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=Jun.Lei@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=wenjing.liu@amd.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

all inboxes | Powered by JetHome®