diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-04-09 05:05:04 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-04-17 14:04:51 -0400 |
commit | ed1f041842f0c4226a78fcd96ccb8e6a5433ae9d (patch) | |
tree | 39d1f23b90f566646ce8a4f4c4f30358cab6cd39 /drivers/dma/xgene-dma.c | |
parent | d7d8e892aa6fe280a2e2974d9fd1ec9253ee1a05 (diff) |
dmaengine: xgene: buffer overflow in xgene_dma_init_channels()
We put 9 characters into the 8 character name[] array. Let's make the
array bigger and change the sprintf() to snprintf().
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/xgene-dma.c')
-rwxr-xr-x | drivers/dma/xgene-dma.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c index aa61935ee706..06d40427aa08 100755 --- a/drivers/dma/xgene-dma.c +++ b/drivers/dma/xgene-dma.c | |||
@@ -314,7 +314,7 @@ struct xgene_dma_chan { | |||
314 | struct device *dev; | 314 | struct device *dev; |
315 | int id; | 315 | int id; |
316 | int rx_irq; | 316 | int rx_irq; |
317 | char name[8]; | 317 | char name[10]; |
318 | spinlock_t lock; | 318 | spinlock_t lock; |
319 | int pending; | 319 | int pending; |
320 | int max_outstanding; | 320 | int max_outstanding; |
@@ -1876,7 +1876,7 @@ static void xgene_dma_init_channels(struct xgene_dma *pdma) | |||
1876 | chan->dev = pdma->dev; | 1876 | chan->dev = pdma->dev; |
1877 | chan->pdma = pdma; | 1877 | chan->pdma = pdma; |
1878 | chan->id = i; | 1878 | chan->id = i; |
1879 | sprintf(chan->name, "dmachan%d", chan->id); | 1879 | snprintf(chan->name, sizeof(chan->name), "dmachan%d", chan->id); |
1880 | } | 1880 | } |
1881 | } | 1881 | } |
1882 | 1882 | ||