]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/omap: Check for failure of a call to omap_iommu_dump_ctx
authorColin Ian King <colin.king@canonical.com>
Tue, 14 Jul 2020 19:22:11 +0000 (20:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 09:02:10 +0000 (11:02 +0200)
commitbfe998e5c66efe54be87ffaa0a9c51245fa4645c
tree0e3b952298f5dcb7d678c1fbac3e3fab7a5c9390
parent248a9ca0dd2eb21a6491bf223fe7b2a3274f4892
iommu/omap: Check for failure of a call to omap_iommu_dump_ctx

[ Upstream commit dee9d154f40c58d02f69acdaa5cfd1eae6ebc28b ]

It is possible for the call to omap_iommu_dump_ctx to return
a negative error number, so check for the failure and return
the error number rather than pass the negative value to
simple_read_from_buffer.

Fixes: 14e0e6796a0d ("OMAP: iommu: add initial debugfs support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200714192211.744776-1-colin.king@canonical.com
Addresses-Coverity: ("Improper use of negative value")
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/omap-iommu-debug.c