Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos/ipp: fix error return code

Propagate the returned error code on failure.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Julia Lawall and committed by
Inki Dae
be19d933 4846e452

+3
+3
drivers/gpu/drm/exynos/exynos_drm_ipp.c
··· 426 426 c_node->start_work = ipp_create_cmd_work(); 427 427 if (IS_ERR(c_node->start_work)) { 428 428 DRM_ERROR("failed to create start work.\n"); 429 + ret = PTR_ERR(c_node->start_work); 429 430 goto err_remove_id; 430 431 } 431 432 432 433 c_node->stop_work = ipp_create_cmd_work(); 433 434 if (IS_ERR(c_node->stop_work)) { 434 435 DRM_ERROR("failed to create stop work.\n"); 436 + ret = PTR_ERR(c_node->stop_work); 435 437 goto err_free_start; 436 438 } 437 439 438 440 c_node->event_work = ipp_create_event_work(); 439 441 if (IS_ERR(c_node->event_work)) { 440 442 DRM_ERROR("failed to create event work.\n"); 443 + ret = PTR_ERR(c_node->event_work); 441 444 goto err_free_stop; 442 445 } 443 446