summaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat
diff options
context:
space:
mode:
authorAllen Hubbe <Allen.Hubbe@emc.com>2015-08-11 10:05:43 +0200
committerVinod Koul <vinod.koul@intel.com>2015-08-17 10:05:58 +0200
commit5484526ac120eb543e5a28610775f04014814d89 (patch)
tree19f4a05f497e8e5a0be74d08aa3140e960aeda14 /drivers/dma/ioat
parentdmaengine: ioatdma: fix u16 overflow in reshape (diff)
downloadlinux-5484526ac120eb543e5a28610775f04014814d89.tar.xz
linux-5484526ac120eb543e5a28610775f04014814d89.zip
dmaengine: ioatdma: fix u16 overflow in cleanup
If the allocation order is 16, then the u16 count will overflow and wrap to zero when assigned the value 1 << 16. Change the type of 'total_descs' to int, so that it is large enough to store a value equal or greater than 1 << 16. Signed-off-by: Allen Hubbe <Allen.Hubbe@emc.com> Acked-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/ioat')
-rw-r--r--drivers/dma/ioat/dma_v2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
index 13fbd9d5b5b9..0fba93c2feb4 100644
--- a/drivers/dma/ioat/dma_v2.c
+++ b/drivers/dma/ioat/dma_v2.c
@@ -798,7 +798,7 @@ void ioat2_free_chan_resources(struct dma_chan *c)
struct ioat_chan_common *chan = &ioat->base;
struct ioatdma_device *device = chan->device;
struct ioat_ring_ent *desc;
- const u16 total_descs = 1 << ioat->alloc_order;
+ const int total_descs = 1 << ioat->alloc_order;
int descs;
int i;