提交 79513237 编写于 作者: D Dan Carpenter 提交者: Eric Anholt

drm/vc4: checking for NULL instead of IS_ERR

vc4_plane_init() returns an ERR_PTR on error, it doesn't return NULL.
This was obviously intended because the next lines call
PTR_ERR(primary_plane) already.

Fixes: c8b75bca ('Eric Anholt <eric@anholt.net>')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NEric Anholt <eric@anholt.net>
上级 2fa8e904
...@@ -591,14 +591,14 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) ...@@ -591,14 +591,14 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
* that will take too much. * that will take too much.
*/ */
primary_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_PRIMARY); primary_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_PRIMARY);
if (!primary_plane) { if (IS_ERR(primary_plane)) {
dev_err(dev, "failed to construct primary plane\n"); dev_err(dev, "failed to construct primary plane\n");
ret = PTR_ERR(primary_plane); ret = PTR_ERR(primary_plane);
goto err; goto err;
} }
cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR); cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR);
if (!cursor_plane) { if (IS_ERR(cursor_plane)) {
dev_err(dev, "failed to construct cursor plane\n"); dev_err(dev, "failed to construct cursor plane\n");
ret = PTR_ERR(cursor_plane); ret = PTR_ERR(cursor_plane);
goto err_primary; goto err_primary;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册