Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: sahara - fix error handling in sahara_hw_descriptor_create()

Do not call dma_unmap_sg() for scatterlists that were not mapped
successfully.

Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Ovidiu Panait and committed by
Herbert Xu
ee6e6f0a 5b8668ce

+3 -5
+3 -5
drivers/crypto/sahara.c
··· 483 483 DMA_TO_DEVICE); 484 484 if (!ret) { 485 485 dev_err(dev->device, "couldn't map in sg\n"); 486 - goto unmap_in; 486 + return -EINVAL; 487 487 } 488 + 488 489 ret = dma_map_sg(dev->device, dev->out_sg, dev->nb_out_sg, 489 490 DMA_FROM_DEVICE); 490 491 if (!ret) { 491 492 dev_err(dev->device, "couldn't map out sg\n"); 492 - goto unmap_out; 493 + goto unmap_in; 493 494 } 494 495 495 496 /* Create input links */ ··· 538 537 539 538 return 0; 540 539 541 - unmap_out: 542 - dma_unmap_sg(dev->device, dev->out_sg, dev->nb_out_sg, 543 - DMA_FROM_DEVICE); 544 540 unmap_in: 545 541 dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg, 546 542 DMA_TO_DEVICE);