media: tegra-cec: fix cec_notifier_parse_hdmi_phandle return check
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 24 Apr 2019 10:09:54 +0000 (06:09 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 8 May 2019 18:02:45 +0000 (14:02 -0400)
cec_notifier_parse_hdmi_phandle returns an error pointer, not a NULL
pointer on error.

Fixes: 4d34c9267db7: ("media: tegra_cec: use new cec_notifier_parse_hdmi_phandle helper")
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/tegra-cec/tegra_cec.c

index 7fb3a4fa07c1e7d674a4a39e414b51f40f5656e7..447bdfbe5afe190ca2e5ca67ce990a9291729e7a 100644 (file)
@@ -334,8 +334,8 @@ static int tegra_cec_probe(struct platform_device *pdev)
 
        hdmi_dev = cec_notifier_parse_hdmi_phandle(&pdev->dev);
 
-       if (!hdmi_dev)
-               return -ENODEV;
+       if (IS_ERR(hdmi_dev))
+               return PTR_ERR(hdmi_dev);
 
        cec = devm_kzalloc(&pdev->dev, sizeof(struct tegra_cec), GFP_KERNEL);