mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
drm/rockchip: fix a couple off by one bugs
The priv->crtc_funcs[] array has ROCKCHIP_MAX_CRTC elements so > should
be >= here.
Fixes: 2048e3286f ('drm: rockchip: Add basic drm driver')
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
This commit is contained in:
parent
44958207d6
commit
15da78084d
1 changed files with 2 additions and 2 deletions
|
|
@ -79,7 +79,7 @@ int rockchip_register_crtc_funcs(struct drm_crtc *crtc,
|
|||
int pipe = drm_crtc_index(crtc);
|
||||
struct rockchip_drm_private *priv = crtc->dev->dev_private;
|
||||
|
||||
if (pipe > ROCKCHIP_MAX_CRTC)
|
||||
if (pipe >= ROCKCHIP_MAX_CRTC)
|
||||
return -EINVAL;
|
||||
|
||||
priv->crtc_funcs[pipe] = crtc_funcs;
|
||||
|
|
@ -92,7 +92,7 @@ void rockchip_unregister_crtc_funcs(struct drm_crtc *crtc)
|
|||
int pipe = drm_crtc_index(crtc);
|
||||
struct rockchip_drm_private *priv = crtc->dev->dev_private;
|
||||
|
||||
if (pipe > ROCKCHIP_MAX_CRTC)
|
||||
if (pipe >= ROCKCHIP_MAX_CRTC)
|
||||
return;
|
||||
|
||||
priv->crtc_funcs[pipe] = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue