mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 12:00:22 +09:00
drm: rcar-du: Fix a NULL vs IS_ERR() bug
[ Upstream commit40f43730f4] The drmm_encoder_alloc() function returns error pointers. It never returns NULL. Fix the check accordingly. Fixes:7a1adbd239("drm: rcar-du: Use drmm_encoder_alloc() to manage encoder") Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3cfaa8713e
commit
d3047a1b04
@@ -109,8 +109,8 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
|
||||
renc = drmm_encoder_alloc(&rcdu->ddev, struct rcar_du_encoder, base,
|
||||
&rcar_du_encoder_funcs, DRM_MODE_ENCODER_NONE,
|
||||
NULL);
|
||||
if (!renc)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(renc))
|
||||
return PTR_ERR(renc);
|
||||
|
||||
renc->output = output;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user