diff options
author | Dave Jiang <dave.jiang@intel.com> | 2012-04-05 03:10:35 +0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2012-04-06 02:22:58 +0400 |
commit | 21b764e075e74f8af90da9f623aa3e2167484687 (patch) | |
tree | 4ecbcdb82fdc3790d646bcd64b4cb5b481d1ad44 /drivers/dma/ioat/dma_v2.c | |
parent | 3d9ea9e3af048ab6b8dced15248384e548ba05ea (diff) | |
download | linux-21b764e075e74f8af90da9f623aa3e2167484687.tar.xz |
ioat: ring size variables need to be 32bit to avoid overflow
The alloc order can be up to 16 and 1 << 16 will over flow the 16bit
integer. Change the appropriate variables to 16bit to avoid overflow.
Reported-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/ioat/dma_v2.c')
-rw-r--r-- | drivers/dma/ioat/dma_v2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c index cb8864d45601..143cb1b3cb26 100644 --- a/drivers/dma/ioat/dma_v2.c +++ b/drivers/dma/ioat/dma_v2.c @@ -575,9 +575,9 @@ bool reshape_ring(struct ioat2_dma_chan *ioat, int order) */ struct ioat_chan_common *chan = &ioat->base; struct dma_chan *c = &chan->common; - const u16 curr_size = ioat2_ring_size(ioat); + const u32 curr_size = ioat2_ring_size(ioat); const u16 active = ioat2_ring_active(ioat); - const u16 new_size = 1 << order; + const u32 new_size = 1 << order; struct ioat_ring_ent **ring; u16 i; |