All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: mobiveil: integer overflow in IB_WIN_SIZE
@ 2018-07-05  9:45 ` Dan Carpenter
  0 siblings, 0 replies; 16+ messages in thread
From: Dan Carpenter @ 2018-07-05  9:45 UTC (permalink / raw)
  To: Subrahmanya Lingappa
  Cc: Lorenzo Pieralisi, Bjorn Helgaas, linux-pci, kernel-janitors

IB_WIN_SIZE is larger than INT_MAX so we need to cast it to u64.

Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Untested...  Possibly the problem is that there are too many multiplies
by * 1024.

diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c
index 4d6c20e47bed..cf0aa7cee5b0 100644
--- a/drivers/pci/controller/pcie-mobiveil.c
+++ b/drivers/pci/controller/pcie-mobiveil.c
@@ -107,7 +107,7 @@
 #define CFG_WINDOW_TYPE	0
 #define IO_WINDOW_TYPE		1
 #define MEM_WINDOW_TYPE	2
-#define IB_WIN_SIZE		(256 * 1024 * 1024 * 1024)
+#define IB_WIN_SIZE		((u64)256 * 1024 * 1024 * 1024)
 #define MAX_PIO_WINDOWS	8
 
 /* Parameters for the waiting for link up routine */

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-08-01  8:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-05  9:45 [PATCH] PCI: mobiveil: integer overflow in IB_WIN_SIZE Dan Carpenter
2018-07-05  9:45 ` Dan Carpenter
2018-07-06 11:26 ` Lorenzo Pieralisi
2018-07-06 11:26   ` Lorenzo Pieralisi
2018-07-09 10:25   ` Subrahmanya Lingappa
2018-07-09 10:37     ` Subrahmanya Lingappa
2018-07-09 11:42     ` Lorenzo Pieralisi
2018-07-09 11:42       ` Lorenzo Pieralisi
2018-07-16  6:40       ` Subrahmanya Lingappa
2018-07-16  6:52         ` Subrahmanya Lingappa
2018-07-26  9:46         ` Lorenzo Pieralisi
2018-07-26  9:46           ` Lorenzo Pieralisi
2018-07-26 10:56 ` Lorenzo Pieralisi
2018-07-26 10:56   ` Lorenzo Pieralisi
2018-08-01  7:07   ` Subrahmanya Lingappa
2018-08-01  7:19     ` Subrahmanya Lingappa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.