diff options
author | Kevin Hilman <khilman@baylibre.com> | 2017-07-11 15:07:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-07-19 15:13:04 -0400 |
commit | 5a634ae0b158f845fe7f9603ae843f429b8a4c85 (patch) | |
tree | fb61bec8e1c677d78526ae74dc144c3f22161061 /drivers/media/platform | |
parent | e5c50e130ddc7976a989b1412ded4cd35ac7a8b0 (diff) |
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 <dan.carpenter@oracle.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/davinci/vpif_capture.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; } |