Skip to content

Commit 0528674

Browse files
committed
iommu: Convert unreachable() to BUG()
JIRA: https://issues.redhat.com/browse/RHEL-114131 Upstream-Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit 3a2ffd3 Author: Josh Poimboeuf <jpoimboe@kernel.org> Date: Wed Mar 26 22:28:46 2025 -0700 iommu: Convert unreachable() to BUG() Bare unreachable() should be avoided as it generates undefined behavior, e.g. falling through to the next function. Use BUG() instead so the error is defined. Fixes the following warnings: drivers/iommu/dma-iommu.o: warning: objtool: iommu_dma_sw_msi+0x92: can't find jump dest instruction at .text+0x54d5 vmlinux.o: warning: objtool: iommu_dma_get_msi_page() falls through to next function __iommu_dma_unmap() Link: https://patch.msgid.link/r/0c801ae017ec078cacd39f8f0898fc7780535f85.1743053325.git.jpoimboe@kernel.org Reported-by: Randy Dunlap <rdunlap@infradead.org> Closes: https://lore.kernel.org/314f8809-cd59-479b-97d7-49356bf1c8d1@infradead.org Reported-by: Paul E. McKenney <paulmck@kernel.org> Closes: https://lore.kernel.org/5dd1f35e-8ece-43b7-ad6d-86d02d2718f6@paulmck-laptop Fixes: 6aa63a4 ("iommu: Sort out domain user data") Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> (cherry picked from commit 3a2ffd3) Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
1 parent 964e8f9 commit 0528674

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iommu/dma-iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,7 @@ static size_t cookie_msi_granule(const struct iommu_domain *domain)
21232123
case IOMMU_COOKIE_DMA_MSI:
21242124
return PAGE_SIZE;
21252125
default:
2126-
unreachable();
2126+
BUG();
21272127
};
21282128
}
21292129

@@ -2135,7 +2135,7 @@ static struct list_head *cookie_msi_pages(const struct iommu_domain *domain)
21352135
case IOMMU_COOKIE_DMA_MSI:
21362136
return &domain->msi_cookie->msi_page_list;
21372137
default:
2138-
unreachable();
2138+
BUG();
21392139
};
21402140
}
21412141

0 commit comments

Comments
 (0)