drivers: dce: fix cert_c defect

Dereferencing match, which could be NULL. Add a sanity check before
using it.

CID 451824

Bug 3512545

Change-Id: I367274508d331f602763a38ad7b1d26c2e876179
Signed-off-by: Prateek Patel <prpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2702272
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Prateek Patel
2022-04-25 07:05:41 +00:00
committed by Laxman Dewangan
parent 631f4aafe9
commit 183b03657c

View File

@@ -189,6 +189,11 @@ static int tegra_dce_probe(struct platform_device *pdev)
const struct of_device_id *match = NULL;
match = of_match_device(tegra_dce_of_match, dev);
if (!match) {
dev_info(dev, "no device match found\n");
return -ENODEV;
}
pdata = (struct dce_platform_data *)match->data;
WARN_ON(!pdata);