mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 11:19:37 +00:00
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>
This commit is contained in:
parent
870ce49022
commit
5484526ac1
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue