From: Kevin Hilman Date: Tue, 11 Jul 2017 19:07:52 +0000 (-0400) Subject: media: davinci: vpif_capture: fix potential NULL deref X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5a634ae0b158f845fe7f9603ae843f429b8a4c85;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git media: davinci: vpif_capture: fix potential NULL deref Fix potential NULL pointer dereference in the error path of memory allocation failure. Reported-by: Dan Carpenter Signed-off-by: Kevin Hilman Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 70ffba70164f..fe2a5748e554 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -1593,9 +1593,11 @@ vpif_capture_get_pdata(struct platform_device *pdev) } done: - pdata->asd_sizes[0] = i; - pdata->subdev_count = i; - pdata->card_name = "DA850/OMAP-L138 Video Capture"; + if (pdata) { + pdata->asd_sizes[0] = i; + pdata->subdev_count = i; + pdata->card_name = "DA850/OMAP-L138 Video Capture"; + } return pdata; }