From: Julia Lawall <julia.lawall@lip6.fr>
To: Harry Wentland <harry.wentland@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Tony Cheng <Tony.Cheng@amd.com>,
kbuild-all@01.org, dri-devel@lists.freedesktop.org
Subject: [radeon-alex:amd-staging-drm-next 773/843] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3388:8-15: ERROR: acrtc is NULL but dereferenced. (fwd)
Date: Tue, 15 Aug 2017 13:42:50 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1708151341090.3849@hadrien> (raw)
The NULL comment is referring to the path to line 3388 via line 3360. But
if the value is not NULL, there will be an update of previously freed
memory.
julia
---------- Forwarded message ----------
Date: Tue, 15 Aug 2017 18:58:51 +0800
From: kbuild test robot <fengguang.wu@intel.com>
To: kbuild@01.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Subject: [radeon-alex:amd-staging-drm-next 773/843]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3388:8-15:
ERROR: acrtc is NULL but dereferenced.
CC: kbuild-all@01.org
CC: dri-devel@lists.freedesktop.org
TO: Harry Wentland <harry.wentland@amd.com>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: Tony Cheng <Tony.Cheng@amd.com>
tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head: aec1199c9095951449e3932fac49ddeb9e99884a
commit: 6d597da6c6c4b58a79887039db8fe5b221ccef3f [773/843] drm/amd/display: Fix ckeckpatch problems in amdgpu_dm
:::::: branch date: 12 hours ago
:::::: commit date: 14 hours ago
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3388:8-15: ERROR: acrtc is NULL but dereferenced.
git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
git remote update radeon-alex
git checkout 6d597da6c6c4b58a79887039db8fe5b221ccef3f
vim +3388 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c
83b1852f6 Harry Wentland 2017-08-10 3341
83b1852f6 Harry Wentland 2017-08-10 3342 int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
83b1852f6 Harry Wentland 2017-08-10 3343 struct drm_plane *plane,
83b1852f6 Harry Wentland 2017-08-10 3344 uint32_t crtc_index)
83b1852f6 Harry Wentland 2017-08-10 3345 {
83b1852f6 Harry Wentland 2017-08-10 3346 struct amdgpu_crtc *acrtc = NULL;
83b1852f6 Harry Wentland 2017-08-10 3347 struct amdgpu_plane *cursor_plane;
83b1852f6 Harry Wentland 2017-08-10 3348
83b1852f6 Harry Wentland 2017-08-10 3349 int res = -ENOMEM;
83b1852f6 Harry Wentland 2017-08-10 3350
83b1852f6 Harry Wentland 2017-08-10 3351 cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL);
83b1852f6 Harry Wentland 2017-08-10 3352 if (!cursor_plane)
83b1852f6 Harry Wentland 2017-08-10 3353 goto fail;
83b1852f6 Harry Wentland 2017-08-10 3354
83b1852f6 Harry Wentland 2017-08-10 3355 cursor_plane->base.type = DRM_PLANE_TYPE_CURSOR;
83b1852f6 Harry Wentland 2017-08-10 3356 res = amdgpu_dm_plane_init(dm, cursor_plane, 0);
83b1852f6 Harry Wentland 2017-08-10 3357
83b1852f6 Harry Wentland 2017-08-10 3358 acrtc = kzalloc(sizeof(struct amdgpu_crtc), GFP_KERNEL);
83b1852f6 Harry Wentland 2017-08-10 3359 if (!acrtc)
83b1852f6 Harry Wentland 2017-08-10 3360 goto fail;
83b1852f6 Harry Wentland 2017-08-10 3361
83b1852f6 Harry Wentland 2017-08-10 3362 res = drm_crtc_init_with_planes(
83b1852f6 Harry Wentland 2017-08-10 3363 dm->ddev,
83b1852f6 Harry Wentland 2017-08-10 3364 &acrtc->base,
83b1852f6 Harry Wentland 2017-08-10 3365 plane,
83b1852f6 Harry Wentland 2017-08-10 3366 &cursor_plane->base,
83b1852f6 Harry Wentland 2017-08-10 3367 &amdgpu_dm_crtc_funcs, NULL);
83b1852f6 Harry Wentland 2017-08-10 3368
83b1852f6 Harry Wentland 2017-08-10 3369 if (res)
83b1852f6 Harry Wentland 2017-08-10 3370 goto fail;
83b1852f6 Harry Wentland 2017-08-10 3371
83b1852f6 Harry Wentland 2017-08-10 3372 drm_crtc_helper_add(&acrtc->base, &amdgpu_dm_crtc_helper_funcs);
83b1852f6 Harry Wentland 2017-08-10 3373
83b1852f6 Harry Wentland 2017-08-10 3374 acrtc->max_cursor_width = dm->adev->dm.dc->caps.max_cursor_size;
83b1852f6 Harry Wentland 2017-08-10 3375 acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size;
83b1852f6 Harry Wentland 2017-08-10 3376
83b1852f6 Harry Wentland 2017-08-10 3377 acrtc->crtc_id = crtc_index;
83b1852f6 Harry Wentland 2017-08-10 3378 acrtc->base.enabled = false;
83b1852f6 Harry Wentland 2017-08-10 3379
83b1852f6 Harry Wentland 2017-08-10 3380 dm->adev->mode_info.crtcs[crtc_index] = acrtc;
83b1852f6 Harry Wentland 2017-08-10 3381 drm_mode_crtc_set_gamma_size(&acrtc->base, 256);
83b1852f6 Harry Wentland 2017-08-10 3382
83b1852f6 Harry Wentland 2017-08-10 3383 return 0;
83b1852f6 Harry Wentland 2017-08-10 3384
83b1852f6 Harry Wentland 2017-08-10 3385 fail:
83b1852f6 Harry Wentland 2017-08-10 3386 kfree(acrtc);
83b1852f6 Harry Wentland 2017-08-10 3387 kfree(cursor_plane);
83b1852f6 Harry Wentland 2017-08-10 @3388 acrtc->crtc_id = -1;
83b1852f6 Harry Wentland 2017-08-10 3389 return res;
83b1852f6 Harry Wentland 2017-08-10 3390 }
83b1852f6 Harry Wentland 2017-08-10 3391
:::::: The code at line 3388 was first introduced by commit
:::::: 83b1852f69c8d142d274f932b5a72bac2bf50953 drm/amd/display: Merge amdgpu_dm_types and amdgpu_dm
:::::: TO: Harry Wentland <harry.wentland@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
reply other threads:[~2017-08-15 11:42 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=alpine.DEB.2.20.1708151341090.3849@hadrien \
--to=julia.lawall@lip6.fr \
--cc=Tony.Cheng@amd.com \
--cc=alexander.deucher@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=kbuild-all@01.org \
/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