[radeon-alex:amd-staging-4.7 5/11] drivers/gpu/drm/amd/amdgpu/dce_virtual.c:662:3: warning: 'connector' may be used uninitialized in this function

kbuild test robot fengguang.wu at intel.com
Mon Oct 10 23:18:41 UTC 2016


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-4.7
head:   517e97f3ca3ec310723e8cfef69fdffb7774d5fc
commit: babb7eaf81f0e146b73170cfaafee5b10a5e2262 [5/11] drm/amdgpu: simplify encoder and connector setup
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout babb7eaf81f0e146b73170cfaafee5b10a5e2262
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/dce_virtual.c: In function 'dce_virtual_sw_init':
>> drivers/gpu/drm/amd/amdgpu/dce_virtual.c:662:3: warning: 'connector' may be used uninitialized in this function [-Wmaybe-uninitialized]
      kfree(connector);
      ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/dce_virtual.c:657:24: note: 'connector' was declared here
     struct drm_connector *connector;
                           ^~~~~~~~~

vim +/connector +662 drivers/gpu/drm/amd/amdgpu/dce_virtual.c

   646		kfree(amdgpu_encoder);
   647	}
   648	
   649	static const struct drm_encoder_funcs dce_virtual_encoder_funcs = {
   650		.destroy = dce_virtual_encoder_destroy,
   651	};
   652	
   653	static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
   654						      int index)
   655	{
   656		struct drm_encoder *encoder;
   657		struct drm_connector *connector;
   658	
   659		/* add a new encoder */
   660		encoder = kzalloc(sizeof(struct drm_encoder), GFP_KERNEL);
   661		if (!encoder) {
 > 662			kfree(connector);
   663			return -ENOMEM;
   664		}
   665		encoder->possible_crtcs = 1 << index;
   666		drm_encoder_init(adev->ddev, encoder, &dce_virtual_encoder_funcs,
   667				 DRM_MODE_ENCODER_VIRTUAL, NULL);
   668		drm_encoder_helper_add(encoder, &dce_virtual_encoder_helper_funcs);
   669	
   670		connector = kzalloc(sizeof(struct drm_connector), GFP_KERNEL);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 43764 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20161011/f14c6662/attachment-0001.gz>


More information about the dri-devel mailing list