Commit 5484526a authored by Allen Hubbe's avatar Allen Hubbe Committed by Vinod Koul

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: default avatarAllen Hubbe <Allen.Hubbe@emc.com>
Acked-by: default avatarDave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 870ce490
...@@ -798,7 +798,7 @@ void ioat2_free_chan_resources(struct dma_chan *c) ...@@ -798,7 +798,7 @@ void ioat2_free_chan_resources(struct dma_chan *c)
struct ioat_chan_common *chan = &ioat->base; struct ioat_chan_common *chan = &ioat->base;
struct ioatdma_device *device = chan->device; struct ioatdma_device *device = chan->device;
struct ioat_ring_ent *desc; struct ioat_ring_ent *desc;
const u16 total_descs = 1 << ioat->alloc_order; const int total_descs = 1 << ioat->alloc_order;
int descs; int descs;
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment