提交 ed1f0418 编写于 作者: D Dan Carpenter 提交者: Vinod Koul

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 d7d8e892
......@@ -314,7 +314,7 @@ struct xgene_dma_chan {
struct device *dev;
int id;
int rx_irq;
char name[8];
char name[10];
spinlock_t lock;
int pending;
int max_outstanding;
......@@ -1876,7 +1876,7 @@ static void xgene_dma_init_channels(struct xgene_dma *pdma)
chan->dev = pdma->dev;
chan->pdma = pdma;
chan->id = i;
sprintf(chan->name, "dmachan%d", chan->id);
snprintf(chan->name, sizeof(chan->name), "dmachan%d", chan->id);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册