[media] v4l: xilinx: harmless buffer overflow
[linux-2.6-block.git] / drivers / media / platform / xilinx / xilinx-dma.c
index 10209c294168a168f2726ed1a87d3c1cf02b8fb3..98e50e446d57a2b835d93e65992a55ebc1918713 100644 (file)
@@ -12,7 +12,7 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/amba/xilinx_dma.h>
+#include <linux/dma/xilinx_dma.h>
 #include <linux/lcm.h>
 #include <linux/list.h>
 #include <linux/module.h>
@@ -653,7 +653,7 @@ static const struct v4l2_file_operations xvip_dma_fops = {
 int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,
                  enum v4l2_buf_type type, unsigned int port)
 {
-       char name[14];
+       char name[16];
        int ret;
 
        dma->xdev = xdev;
@@ -725,7 +725,7 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,
        }
 
        /* ... and the DMA channel. */
-       sprintf(name, "port%u", port);
+       snprintf(name, sizeof(name), "port%u", port);
        dma->dma = dma_request_slave_channel(dma->xdev->dev, name);
        if (dma->dma == NULL) {
                dev_err(dma->xdev->dev, "no VDMA channel found\n");