drm/msm: Move call to PTR_ERR_OR_ZERO after reassignment
authorVaishali Thakkar <vaishali.thakkar@oracle.com>
Thu, 28 Apr 2016 13:22:49 +0000 (18:52 +0530)
committerRob Clark <robdclark@gmail.com>
Sun, 8 May 2016 14:22:16 +0000 (10:22 -0400)
commitd6c925cada0d92e49c3473bc0a69ea3913fff905
treecdc28b0bbba63afb866e8f087ef214aa119ba109
parent30c6bfe8abb51098889c6f894641aff22d2a65d1
drm/msm: Move call to PTR_ERR_OR_ZERO after reassignment

Here, a location is reset to NULL before being passed to PTR_ERR.
So, PTR_ERR should be called before its argument is reassigned
to NULL. Further to simplify things use PTR_ERR_OR_ZERO instead
of PTR_ERR and IS_ERR.

Problem found using Coccinelle.

Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[fixed fmt string warning (s/%ld/%d/)]
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/edp/edp_ctrl.c