drm/rockchip: fix some warning from smatch check
authorMark Yao <mark.yao@rock-chips.com>
Thu, 19 Jan 2017 07:01:03 +0000 (15:01 +0800)
committerMark Yao <mark.yao@rock-chips.com>
Thu, 19 Jan 2017 07:25:13 +0000 (15:25 +0800)
commitdf50a2009ba8fa3dd1ecb1a8b194399e2787da3d
treeb40ef1165c974630a7b663542de0dd1aa318d837
parent949dd102635350b48646cedaf5e9cbc792bb42f2
drm/rockchip: fix some warning from smatch check

drivers/gpu/drm/rockchip/rockchip_drm_drv.c:489
  update_state() warn: variable dereferenced before check 'encoder' (see line 488)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c:687
  rockchip_register_crtc_funcs() error: buffer overflow 'priv->crtc_funcs' 2 <= 2
drivers/gpu/drm/rockchip/rockchip_drm_drv.c:700
  rockchip_unregister_crtc_funcs() error: buffer overflow 'priv->crtc_funcs' 2 <= 2
drivers/gpu/drm/rockchip/rockchip_drm_rga.c:848
  rga_probe() warn: passing zero to 'PTR_ERR'

drivers/gpu/drm/rockchip/rockchip_drm_vop.c:597
  vop_csc_setup() warn: variable dereferenced before check 'y2r_table' (see line 578)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c:1059
  vop_plane_atomic_update() warn: variable dereferenced before check 'crtc' (see line 1041)

drivers/gpu/drm/rockchip/rockchip_lvds.c:88
  lvds_name_to_format() error: strncmp() '"vesa"' too small (5 vs 6)

I don't konw how to fix following error, maybe rga owner can fix it.
drivers/gpu/drm/rockchip/rockchip_drm_rga.c:174
  rga_alloc_dma_buf_for_cmdlist() error: buffer overflow 'cmdlist->data' 64 <= 64

Change-Id: I41cd098dbd2f311d01b4e84cf0d51598264c8e31
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
drivers/gpu/drm/rockchip/rockchip_drm_rga.c
drivers/gpu/drm/rockchip/rockchip_drm_vop.c
drivers/gpu/drm/rockchip/rockchip_lvds.c