drm: rcar-du: Fix the return check of of_parse_phandle and of_find_device_by_node
authorWang Xiaojun <wangxiaojun11@huawei.com>
Wed, 11 Nov 2020 03:14:52 +0000 (11:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:38 +0000 (11:37 +0100)
commit61de9181c86c0a1d5908e95f05d6d8c8daec8d5b
treefbbe3bf181f141ca8419fd8e040ca35fb925a5a0
parent4f6cd7e77b07bef1e3f2c6b08d8e3c991bff9a1b
drm: rcar-du: Fix the return check of of_parse_phandle and of_find_device_by_node

[ Upstream commit 8d7d33f6be06f929ac2c5e8ea2323fec272790d4 ]

of_parse_phandle and of_find_device_by_node may return NULL
which cannot be checked by IS_ERR.

Fixes: 8de707aeb452 ("drm: rcar-du: kms: Initialize CMM instances")
Signed-off-by: Wang Xiaojun <wangxiaojun11@huawei.com>
Reported-by: Hulk Robot <hulkci@huawei.com>
Acked-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
[Replace -ENODEV with -EINVAL]

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/rcar-du/rcar_du_kms.c