diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2014-02-26 20:53:40 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-27 14:57:43 -0800 |
commit | 9f9b036f0e5ee1ea4f0487a793542ca7ba06de35 (patch) | |
tree | 45f0cbebe8a887ba2eb31de591648bf7519e3e72 | |
parent | 058dbde928597e7a8bd04e28e77e5cfc4270591d (diff) |
imx-drm: imx-ldb: Check 'mode' pointer first
Fix the following static checker warning:
drivers/staging/imx-drm/imx-ldb.c:109 imx_ldb_connector_get_modes() error: potential null dereference 'mode'. (drm_mode_create returns null)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/imx-drm/imx-ldb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/imx-drm/imx-ldb.c b/drivers/staging/imx-drm/imx-ldb.c index 5168c76cff53..abf85170f6d6 100644 --- a/drivers/staging/imx-drm/imx-ldb.c +++ b/drivers/staging/imx-drm/imx-ldb.c @@ -106,6 +106,8 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector) struct drm_display_mode *mode; mode = drm_mode_create(connector->dev); + if (!mode) + return -EINVAL; drm_mode_copy(mode, &imx_ldb_ch->mode); mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; drm_mode_probed_add(connector, mode); |