[PATCH] PCI/IOV: "virtfn4294967295\0" requires 17 bytes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Although unlikely, the 'id' value may be as big as 4294967295
(uint32_max) and "virtfn4294967295\0" would require 17 bytes
instead of 16.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: dd7cc44d0 ("PCI: add SR-IOV API for Physical Function driver")
Signed-off-by: Alexey V. Vissarionov <gremlin@xxxxxxxxxxxx>
---
 drivers/pci/iov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 9522175..ad54a07 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -14,7 +14,7 @@
 #include <linux/delay.h>
 #include "pci.h"
 
-#define VIRTFN_ID_LEN	16
+#define VIRTFN_ID_LEN	17
 
 int pci_iov_virtfn_bus(struct pci_dev *dev, int vf_id)
 {

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux