diff mbox

drm/exynos: fix error return code in exynos_drm_ipp_set_property()

Message ID CAPgLHd8Xu8+d7fxtnC0sdQnTDtrZo8jhB8JJ4b2Lp4SYqcjG4A@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun May 7, 2013, 1:24 p.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
ipp_create_cmd_work() return ERR_PTR() on error and never return
NULL, so use IS_ERR() instead of IS_ERR_OR_NULL().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Sachin Kamat May 7, 2013, 2:55 p.m. UTC | #1
Hi Wei Yongjun,

On 7 May 2013 18:54, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> ipp_create_cmd_work() return ERR_PTR() on error and never return
> NULL, so use IS_ERR() instead of IS_ERR_OR_NULL().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---

I have submitted a patch [1] to use IS_ERR instead of IS_ERR_OR_NULL()
for all incorrect instances in this driver.
Please base your patch fixing the return code on top of my patch.

[1] http://lists.freedesktop.org/archives/dri-devel/2013-April/038059.html
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 29d2ad3..b0d6431 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -521,20 +521,23 @@  int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data,
 	c_node->state = IPP_STATE_IDLE;
 
 	c_node->start_work = ipp_create_cmd_work();
-	if (IS_ERR_OR_NULL(c_node->start_work)) {
+	if (IS_ERR(c_node->start_work)) {
 		DRM_ERROR("failed to create start work.\n");
+		ret = PTR_ERR(c_node->start_work);
 		goto err_clear;
 	}
 
 	c_node->stop_work = ipp_create_cmd_work();
-	if (IS_ERR_OR_NULL(c_node->stop_work)) {
+	if (IS_ERR(c_node->stop_work)) {
 		DRM_ERROR("failed to create stop work.\n");
+		ret = PTR_ERR(c_node->stop_work);
 		goto err_free_start;
 	}
 
 	c_node->event_work = ipp_create_event_work();
-	if (IS_ERR_OR_NULL(c_node->event_work)) {
+	if (IS_ERR(c_node->event_work)) {
 		DRM_ERROR("failed to create event work.\n");
+		ret = PTR_ERR(c_node->event_work);
 		goto err_free_stop;
 	}