[radeon-alex:amd-staging-drm-next 772/843] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3387:1-6: ERROR: reference preceded by free on line 3384 (fwd)

Julia Lawall julia.lawall at lip6.fr
Tue Aug 15 11:47:06 UTC 2017


This looks like another variant of the code I just commented on, with the
same problems.  Note also the comments about iterator index variables,
although the code is not shown.  I haven't checked those issues.

julia

---------- Forwarded message ----------
Date: Tue, 15 Aug 2017 17:33:08 +0800
From: kbuild test robot <fengguang.wu at intel.com>
To: kbuild at 01.org
Cc: Julia Lawall <julia.lawall at lip6.fr>
Subject: [radeon-alex:amd-staging-drm-next 772/843]
    drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3387:1-6: ERROR:
     reference preceded by free on line 3384

CC: kbuild-all at 01.org
CC: dri-devel at lists.freedesktop.org
TO: Harry Wentland <harry.wentland at amd.com>
CC: Alex Deucher <alexander.deucher at amd.com>
CC: Tony Cheng <Tony.Cheng at amd.com>

tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   aec1199c9095951449e3932fac49ddeb9e99884a
commit: 83b1852f69c8d142d274f932b5a72bac2bf50953 [772/843] drm/amd/display: Merge amdgpu_dm_types and amdgpu_dm
:::::: branch date: 11 hours ago
:::::: commit date: 13 hours ago

>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3387:1-6: ERROR: reference preceded by free on line 3384
--
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:4641:31-35: ERROR: invalid reference to the index variable of the iterator on line 4628
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:4365:31-35: ERROR: invalid reference to the index variable of the iterator on line 4283

git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
git remote update radeon-alex
git checkout 83b1852f69c8d142d274f932b5a72bac2bf50953
vim +3387 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c

83b1852f6 Harry Wentland 2017-08-10  3338
83b1852f6 Harry Wentland 2017-08-10  3339  int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
83b1852f6 Harry Wentland 2017-08-10  3340  			struct drm_plane *plane,
83b1852f6 Harry Wentland 2017-08-10  3341  			uint32_t crtc_index)
83b1852f6 Harry Wentland 2017-08-10  3342  {
83b1852f6 Harry Wentland 2017-08-10  3343  	struct amdgpu_crtc *acrtc = NULL;
83b1852f6 Harry Wentland 2017-08-10  3344  	struct amdgpu_plane *cursor_plane;
83b1852f6 Harry Wentland 2017-08-10  3345
83b1852f6 Harry Wentland 2017-08-10  3346  	int res = -ENOMEM;
83b1852f6 Harry Wentland 2017-08-10  3347
83b1852f6 Harry Wentland 2017-08-10  3348  	cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL);
83b1852f6 Harry Wentland 2017-08-10  3349  	if (!cursor_plane)
83b1852f6 Harry Wentland 2017-08-10  3350  		goto fail;
83b1852f6 Harry Wentland 2017-08-10  3351
83b1852f6 Harry Wentland 2017-08-10  3352  	cursor_plane->base.type = DRM_PLANE_TYPE_CURSOR;
83b1852f6 Harry Wentland 2017-08-10  3353  	res = amdgpu_dm_plane_init(dm, cursor_plane, 0);
83b1852f6 Harry Wentland 2017-08-10  3354
83b1852f6 Harry Wentland 2017-08-10  3355  	acrtc = kzalloc(sizeof(struct amdgpu_crtc), GFP_KERNEL);
83b1852f6 Harry Wentland 2017-08-10  3356  	if (!acrtc)
83b1852f6 Harry Wentland 2017-08-10  3357  		goto fail;
83b1852f6 Harry Wentland 2017-08-10  3358
83b1852f6 Harry Wentland 2017-08-10  3359  	res = drm_crtc_init_with_planes(
83b1852f6 Harry Wentland 2017-08-10  3360  			dm->ddev,
83b1852f6 Harry Wentland 2017-08-10  3361  			&acrtc->base,
83b1852f6 Harry Wentland 2017-08-10  3362  			plane,
83b1852f6 Harry Wentland 2017-08-10  3363  			&cursor_plane->base,
83b1852f6 Harry Wentland 2017-08-10  3364  			&amdgpu_dm_crtc_funcs, NULL);
83b1852f6 Harry Wentland 2017-08-10  3365
83b1852f6 Harry Wentland 2017-08-10  3366  	if (res)
83b1852f6 Harry Wentland 2017-08-10  3367  		goto fail;
83b1852f6 Harry Wentland 2017-08-10  3368
83b1852f6 Harry Wentland 2017-08-10  3369  	drm_crtc_helper_add(&acrtc->base, &amdgpu_dm_crtc_helper_funcs);
83b1852f6 Harry Wentland 2017-08-10  3370
83b1852f6 Harry Wentland 2017-08-10  3371  	acrtc->max_cursor_width = dm->adev->dm.dc->caps.max_cursor_size;
83b1852f6 Harry Wentland 2017-08-10  3372  	acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size;
83b1852f6 Harry Wentland 2017-08-10  3373
83b1852f6 Harry Wentland 2017-08-10  3374  	acrtc->crtc_id = crtc_index;
83b1852f6 Harry Wentland 2017-08-10  3375  	acrtc->base.enabled = false;
83b1852f6 Harry Wentland 2017-08-10  3376
83b1852f6 Harry Wentland 2017-08-10  3377  	dm->adev->mode_info.crtcs[crtc_index] = acrtc;
83b1852f6 Harry Wentland 2017-08-10  3378  	drm_mode_crtc_set_gamma_size(&acrtc->base, 256);
83b1852f6 Harry Wentland 2017-08-10  3379
83b1852f6 Harry Wentland 2017-08-10  3380  	return 0;
83b1852f6 Harry Wentland 2017-08-10  3381
83b1852f6 Harry Wentland 2017-08-10  3382  fail:
83b1852f6 Harry Wentland 2017-08-10  3383  	if (acrtc)
83b1852f6 Harry Wentland 2017-08-10 @3384  		kfree(acrtc);
83b1852f6 Harry Wentland 2017-08-10  3385  	if (cursor_plane)
83b1852f6 Harry Wentland 2017-08-10  3386  		kfree(cursor_plane);
83b1852f6 Harry Wentland 2017-08-10 @3387  	acrtc->crtc_id = -1;
83b1852f6 Harry Wentland 2017-08-10  3388  	return res;
83b1852f6 Harry Wentland 2017-08-10  3389  }
83b1852f6 Harry Wentland 2017-08-10  3390

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


More information about the dri-devel mailing list