summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2013-06-05 11:03:14 -0700
committerEric Nelson <eric.nelson@boundarydevices.com>2013-06-09 10:55:52 -0700
commitc334d2567b876c06254a24cee16d68beecb2629d (patch)
treedaab44c5787f5f0c65bcd013824cb51e31408155 /drivers
parente70ce27576da273efa0d9e63122d363faa1ffc4d (diff)
mxc_vout:check for dma_mask before kmalloc
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/mxc/output/mxc_vout.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/mxc/output/mxc_vout.c b/drivers/media/video/mxc/output/mxc_vout.c
index c8bbff57e451..17206dc4b49b 100644
--- a/drivers/media/video/mxc/output/mxc_vout.c
+++ b/drivers/media/video/mxc/output/mxc_vout.c
@@ -2058,10 +2058,12 @@ static int mxc_vout_probe(struct platform_device *pdev)
return -ENOMEM;
dev->dev = &pdev->dev;
- dev->dev->dma_mask = kmalloc(sizeof(*dev->dev->dma_mask), GFP_KERNEL);
- *dev->dev->dma_mask = DMA_BIT_MASK(32);
- dev->dev->coherent_dma_mask = DMA_BIT_MASK(32);
-
+ if (!dev->dev->dma_mask) {
+ dev->dev->dma_mask = kmalloc(sizeof(*dev->dev->dma_mask), GFP_KERNEL);
+ if (dev->dev->dma_mask)
+ *dev->dev->dma_mask = DMA_BIT_MASK(32);
+ dev->dev->coherent_dma_mask = DMA_BIT_MASK(32);
+ }
ret = v4l2_device_register(dev->dev, &dev->v4l2_dev);
if (ret) {
dev_err(dev->dev, "v4l2_device_register failed\n");