Skip to content

Commit 574913f

Browse files
floatiousbjorn-helgaas
authored andcommitted
PCI: dwc: Fix potential truncation in dw_pcie_edma_irq_verify()
Increase the size of the string buffer to avoid potential truncation in dw_pcie_edma_irq_verify(). This fixes the following build warning when compiling with W=1: drivers/pci/controller/dwc/pcie-designware.c: In function ‘dw_pcie_edma_detect’: drivers/pci/controller/dwc/pcie-designware.c:989:50: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 3 [-Wformat-truncation=] 989 | snprintf(name, sizeof(name), "dma%d", pci->edma.nr_irqs); | ^~ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 40384c8 commit 574913f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/controller/dwc/pcie-designware.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ static int dw_pcie_edma_irq_verify(struct dw_pcie *pci)
970970
{
971971
struct platform_device *pdev = to_platform_device(pci->dev);
972972
u16 ch_cnt = pci->edma.ll_wr_cnt + pci->edma.ll_rd_cnt;
973-
char name[6];
973+
char name[15];
974974
int ret;
975975

976976
if (pci->edma.nr_irqs == 1)

0 commit comments

Comments
 (0)