linux/drivers/gpu/drm/exynos
Colin Cross fee0c54e28 dma-buf: avoid using IS_ERR_OR_NULL
dma_buf_map_attachment and dma_buf_vmap can return NULL or
ERR_PTR on a error.  This encourages a common buggy pattern in
callers:
	sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL);
	if (IS_ERR_OR_NULL(sgt))
                return PTR_ERR(sgt);

This causes the caller to return 0 on an error.  IS_ERR_OR_NULL
is almost always a sign of poorly-defined error handling.

This patch converts dma_buf_map_attachment to always return
ERR_PTR, and fixes the callers that incorrectly handled NULL.
There are a few more callers that were not checking for NULL
at all, which would have dereferenced a NULL pointer later.
There are also a few more callers that correctly handled NULL
and ERR_PTR differently, I left those alone but they could also
be modified to delete the NULL check.

This patch also converts dma_buf_vmap to always return NULL.
All the callers to dma_buf_vmap only check for NULL, and would
have dereferenced an ERR_PTR and panic'd if one was ever
returned. This is not consistent with the rest of the dma buf
APIs, but matches the expectations of all of the callers.

Signed-off-by: Colin Cross <ccross@android.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07 14:21:09 -08:00
..
exynos_ddc.c drm/exynos: Remove non-DT support in exynos_ddc 2013-09-05 13:43:45 +09:00
exynos_drm_buf.c drm/exynos: fix return value check in lowlevel_buffer_allocate() 2013-09-16 21:57:08 +09:00
exynos_drm_buf.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_drm_connector.c drm/exynos: fimd: replace struct fb_videomode with videomode 2013-09-05 13:43:44 +09:00
exynos_drm_connector.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_drm_core.c drm/exynos: Remove tracking log functions 2013-06-28 21:13:55 +09:00
exynos_drm_crtc.c drm: fix typos in comment in /gpu/drm/exynos 2013-12-02 14:59:11 +01:00
exynos_drm_crtc.h drm/exynos: move finish page flip to a common place 2013-01-07 13:58:37 +09:00
exynos_drm_dmabuf.c dma-buf: avoid using IS_ERR_OR_NULL 2014-02-07 14:21:09 -08:00
exynos_drm_dmabuf.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_drm_drv.c drm/exynos: use a new anon file for exynos gem mmaper 2014-01-07 16:51:41 +09:00
exynos_drm_drv.h drm/exynos: use a new anon file for exynos gem mmaper 2014-01-07 16:51:41 +09:00
exynos_drm_encoder.c drm/exynos: Remove redundant error messages 2013-09-05 13:43:43 +09:00
exynos_drm_encoder.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_drm_fb.c drm/exynos: Remove redundant error messages 2013-09-05 13:43:43 +09:00
exynos_drm_fb.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_drm_fbdev.c drm/exynos: Fix address space warnings in exynos_drm_fbdev.c 2013-09-16 21:57:06 +09:00
exynos_drm_fbdev.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_drm_fimc.c treewide: Fix typos in printk 2013-12-19 15:10:49 +01:00
exynos_drm_fimc.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_drm_fimd.c drm/exynos: fix build error caused by removed drm core macros 2014-01-07 16:53:25 +09:00
exynos_drm_g2d.c Merge branch 'master' into for-next 2013-12-19 15:08:32 +01:00
exynos_drm_g2d.h drm/exynos: add G2D driver 2012-05-17 20:14:48 +09:00
exynos_drm_gem.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-01-29 20:49:12 -08:00
exynos_drm_gem.h Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-01-29 20:49:12 -08:00
exynos_drm_gsc.c treewide: Fix typos in printk 2013-12-19 15:10:49 +01:00
exynos_drm_gsc.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_drm_hdmi.c drm/exynos: Remove redundant error messages 2013-09-05 13:43:43 +09:00
exynos_drm_hdmi.h drm/exynos: hdmi: use drm_display_mode to check the supported modes 2013-06-28 21:12:52 +09:00
exynos_drm_iommu.c drm/exynos: Add NULL pointer check 2013-09-05 13:43:43 +09:00
exynos_drm_iommu.h drm/exynos: fix iommu address allocation order 2013-02-21 15:00:26 +09:00
exynos_drm_ipp.c drm: fix typos in comment in /gpu/drm/exynos 2013-12-02 14:59:11 +01:00
exynos_drm_ipp.h drm: fix typos in comment in /gpu/drm/exynos 2013-12-02 14:59:11 +01:00
exynos_drm_plane.c drm/exynos: Remove redundant error messages 2013-09-05 13:43:43 +09:00
exynos_drm_plane.h drm/exynos: add plane enable/disable 2012-07-27 11:13:54 +09:00
exynos_drm_rotator.c drm/exynos: Remove redundant error messages 2013-09-05 13:43:43 +09:00
exynos_drm_rotator.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_drm_vidi.c drm: Make irq_enabled bool 2013-10-09 15:55:32 +10:00
exynos_drm_vidi.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_hdmi.c drm/exynos: Remove non-DT support in exynos_hdmi 2013-09-05 13:43:46 +09:00
exynos_hdmi.h drm/exynos: change file license to GPL 2013-01-04 15:54:32 +09:00
exynos_hdmiphy.c drm/exynos: Remove non-DT support in exynos_hdmiphy 2013-09-05 13:43:45 +09:00
exynos_mixer.c drm: Kill DRM_WAKUP and DRM_INIT_WAITQUEUE 2013-12-18 11:34:13 +10:00
Kconfig drm: Add separate Kconfig option for fbdev helpers 2013-10-11 23:36:58 +02:00
Makefile drm/exynos: add gsc ipp driver 2012-12-15 02:40:00 +09:00
regs-fimc.h drm/exynos: add device tree support for fimc ipp driver 2013-04-29 14:35:32 +09:00
regs-gsc.h drm/exynos: add gsc ipp driver 2012-12-15 02:40:00 +09:00
regs-hdmi.h drm/exynos: add support for hdmiphy power control for exynos5 2012-12-14 15:40:49 +09:00
regs-mixer.h drm/exynos: add support for exynos5420 mixer 2013-06-28 21:13:57 +09:00
regs-rotator.h drm/exynos: add rotator ipp driver 2012-12-15 02:39:41 +09:00
regs-vp.h drm/exynos: added hdmi display support 2011-12-29 11:21:42 +09:00