Skip to content

Commit 3ec57b8

Browse files
sandy-huangZhengShunQian
authored andcommitted
drm/rockchip: vop: fix kernel panic when calc bandwidth
error log: [ 35.638112] Internal error: Accessing user space memory outside uaccess.h routines: 96000005 [#1] PREEMPT SMP [ 35.638996] Modules linked in: [ 35.639287] CPU: 3 PID: 226 Comm: surfaceflinger Not tainted 4.4.126 [ 35.639873] Hardware name: Strides RK3399 Development Q7 Board Rev [ 35.640483] task: ffffffc0f100ec00 task.stack:ffffffc0eeaac000 [ 35.641011] PC is at vop_crtc_bandwidth+0x22c/0x310 [ 35.641448] LR is at vop_crtc_bandwidth+0x118/0x310 [ 35.641883] pc : [<ffffff80084af988>] lr :[<ffffff80084af874>] pstate: 60400145 [ 35.642526] sp : ffffffc0eeaafad0 [ 35.642821] x29: ffffffc0eeaafad0 x28: 0000000000000020 ... [ 35.780538] [<ffffff80084af988>] vop_crtc_bandwidth+0x22c/0x310 [ 35.781057] [<ffffff80084a87b4>] rockchip_drm_atomic_commit+0xb0/0x1d0 [ 35.781634] [<ffffff8008491678>] drm_atomic_commit+0x64/0x70 [ 35.782140] [<ffffff8008492b08>] drm_mode_atomic_ioctl+0x5d0/0x6a0 [ 35.782683] [<ffffff8008476b30>] drm_ioctl+0x2e4/0x400 [ 35.783145] [<ffffff80081d0db0>] do_vfs_ioctl+0xa4/0x7d8 [ 35.783616] [<ffffff80081d1540>] SyS_ioctl+0x5c/0x8c [ 35.784055] [<ffffff80080832f0>] el0_svc_naked+0x24/0x28 [ 35.784528] Code: 7100113f 54ffff41 f9412ca0 f9400000 (f9400002) [ 35.785256] ---[ end trace b3812e3405f44f95 ]--- ... Change-Id: I695c9628b155294adcf5135f82e4af901ce1b82c Signed-off-by: Sandy Huang <hjc@rock-chips.com>
1 parent 2e8d999 commit 3ec57b8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2314,7 +2314,8 @@ static size_t vop_plane_line_bandwidth(struct drm_plane_state *pstate)
23142314
int vskiplines = scl_get_vskiplines(src_height, dest_height);
23152315
size_t bandwidth;
23162316

2317-
if (!src_width || !src_height || !dest_width || !dest_height)
2317+
if (src_width <= 0 || src_height <= 0 || dest_width <= 0 ||
2318+
dest_height <= 0)
23182319
return 0;
23192320

23202321
bandwidth = src_width * bpp / 8;

0 commit comments

Comments
 (0)