1
0
Fork 0

LF-1510: gpu: drm: lcdifv3: null return value check for of_id

null return value check for of_id to reslove coverity ID 10058073.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit c444dcf0aee821cf42892d03b698008bd1d6f0f5)
5.4-rM2-2.2.x-imx-squashed
Sandor Yu 2020-06-19 14:00:25 +08:00
parent 5db279fcc5
commit 3119a403b7
1 changed files with 10 additions and 3 deletions

View File

@ -622,12 +622,19 @@ static int imx_lcdifv3_probe(struct platform_device *pdev)
struct lcdifv3_soc *lcdifv3;
struct resource *res;
struct regmap *blk_ctl;
const struct of_device_id *of_id =
of_match_device(imx_lcdifv3_dt_ids, dev);
const struct lcdifv3_soc_pdata *soc_pdata = of_id->data;
const struct of_device_id *of_id;
const struct lcdifv3_soc_pdata *soc_pdata;
dev_dbg(dev, "%s: probe begin\n", __func__);
of_id = of_match_device(imx_lcdifv3_dt_ids, dev);
if (!of_id) {
dev_err(&pdev->dev, "OF data missing\n");
return -EINVAL;
}
soc_pdata = of_id->data;
lcdifv3 = devm_kzalloc(dev, sizeof(*lcdifv3), GFP_KERNEL);
if (!lcdifv3) {
dev_err(dev, "Can't allocate 'lcdifv3_soc' structure\n");