From: Dan Carpenter Date: Mon, 14 Mar 2011 09:35:31 +0000 (+0300) Subject: Staging: crystalhd: don't waste the last char of buffer X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e278913c3c70dea6302d99f5f0ee4961e09970b6;p=linux-beck.git Staging: crystalhd: don't waste the last char of buffer pinfo->name is a 32 char buffer. In the original code, the last char wasn't fully utilized. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c index 9a6b650cd608..c1ee24c98315 100644 --- a/drivers/staging/crystalhd/crystalhd_lnx.c +++ b/drivers/staging/crystalhd/crystalhd_lnx.c @@ -562,7 +562,7 @@ static int __devinit chd_dec_pci_probe(struct pci_dev *pdev, return rc; } - snprintf(pinfo->name, 31, "crystalhd_pci_e:%d:%d:%d", + snprintf(pinfo->name, sizeof(pinfo->name), "crystalhd_pci_e:%d:%d:%d", pdev->bus->number, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));