davinci: vpif_capture: fix potential NULL deref
PATCH 1/1 davinci: vpif_capture: fix potential NULL deref
Fix potential NULL pointer dereference in the error path of memory allocation failure.
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Kevin Hilman <[email protected]>
--- drivers/media/platform/davinci/vpif_capture.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/media/platform/davinci/vpif_capture.c +6 -4
@@ -1593,10 +1593,12 @@ 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; }
Signature · 1 line
2.9.3
Quoted 5 lines · Kevin Hilman
Fix potential NULL pointer dereference in the error path of memory allocation failure.
Reported-by Dan Carpenter <[email protected]>Signed-off-by Kevin Hilman <[email protected]>
Acked-by Sakari Ailus <[email protected]>
Signature · 2 lines
Sakari Ailus e-mail: [email protected] XMPP: [email protected]