1
0
Fork 0
alistair23-linux/drivers/gpu/drm/xen
Oleksandr Andrushchenko 67f8b390b1 drm/xen-front: Fix misused IS_ERR_OR_NULL checks
[ Upstream commit 14dee05861 ]

The patch c575b7eeb89f: "drm/xen-front: Add support for Xen PV
display frontend" from Apr 3, 2018, leads to the following static
checker warning:

	drivers/gpu/drm/xen/xen_drm_front_gem.c:140 xen_drm_front_gem_create()
	warn: passing zero to 'ERR_CAST'

drivers/gpu/drm/xen/xen_drm_front_gem.c
   133  struct drm_gem_object *xen_drm_front_gem_create(struct drm_device *dev,
   134                                                  size_t size)
   135  {
   136          struct xen_gem_object *xen_obj;
   137
   138          xen_obj = gem_create(dev, size);
   139          if (IS_ERR_OR_NULL(xen_obj))
   140                  return ERR_CAST(xen_obj);

Fix this and the rest of misused places with IS_ERR_OR_NULL in the
driver.

Fixes:  c575b7eeb89f: "drm/xen-front: Add support for Xen PV display frontend"

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200813062113.11030-3-andr2000@gmail.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-03 11:26:50 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile drm/xen-front: Use Xen common shared buffer implementation 2018-12-18 12:16:13 -05:00
xen_drm_front.c drm/xen-front: Fix misused IS_ERR_OR_NULL checks 2020-09-03 11:26:50 +02:00
xen_drm_front.h drm/xen: drop use of drmP.h 2019-07-15 18:11:30 +02:00
xen_drm_front_cfg.c drm/xen: drop use of drmP.h 2019-07-15 18:11:30 +02:00
xen_drm_front_cfg.h
xen_drm_front_conn.c drm/xen: drop use of drmP.h 2019-07-15 18:11:30 +02:00
xen_drm_front_conn.h drm/xen: drop use of drmP.h 2019-07-15 18:11:30 +02:00
xen_drm_front_evtchnl.c drm/xen: drop use of drmP.h 2019-07-15 18:11:30 +02:00
xen_drm_front_evtchnl.h
xen_drm_front_gem.c drm/xen-front: Fix misused IS_ERR_OR_NULL checks 2020-09-03 11:26:50 +02:00
xen_drm_front_gem.h drm/xen: drop use of drmP.h 2019-07-15 18:11:30 +02:00
xen_drm_front_kms.c drm/xen-front: Fix misused IS_ERR_OR_NULL checks 2020-09-03 11:26:50 +02:00
xen_drm_front_kms.h