On Wed, Nov 19, 2025 at 05:54:55AM +0000, Tian, Kevin wrote:
From: Leon Romanovsky leon@kernel.org Sent: Tuesday, November 11, 2025 5:58 PM
- if (dma->state && dma_use_iova(dma->state)) {
WARN_ON_ONCE(mapped_len != size);then "goto err_unmap_dma".
It never should happen, there is no need to provide error unwind to something that you won't get.
Reviewed-by: Kevin Tian kevin.tian@intel.com
Thanks
On Wed, Nov 19, 2025 at 03:30:00PM +0200, Leon Romanovsky wrote:
On Wed, Nov 19, 2025 at 05:54:55AM +0000, Tian, Kevin wrote:
From: Leon Romanovsky leon@kernel.org Sent: Tuesday, November 11, 2025 5:58 PM
- if (dma->state && dma_use_iova(dma->state)) {
WARN_ON_ONCE(mapped_len != size);then "goto err_unmap_dma".
It never should happen, there is no need to provide error unwind to something that you won't get.
It is expected that WARN_ON has recovery code, if it is possible and not burdensome.
Jason
On Wed, Nov 19, 2025 at 09:37:08AM -0400, Jason Gunthorpe wrote:
On Wed, Nov 19, 2025 at 03:30:00PM +0200, Leon Romanovsky wrote:
On Wed, Nov 19, 2025 at 05:54:55AM +0000, Tian, Kevin wrote:
From: Leon Romanovsky leon@kernel.org Sent: Tuesday, November 11, 2025 5:58 PM
- if (dma->state && dma_use_iova(dma->state)) {
WARN_ON_ONCE(mapped_len != size);then "goto err_unmap_dma".
It never should happen, there is no need to provide error unwind to something that you won't get.
It is expected that WARN_ON has recovery code, if it is possible and not burdensome.
It’s not necessary, but since I’m calculating mapped_len again, it’s natural—and completely harmless—to double-check the arithmetic.
Thanks
Jason
linaro-mm-sig@lists.linaro.org