]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/ipmmu-vmsa: Check for error num after setting mask
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Thu, 6 Jan 2022 02:43:02 +0000 (10:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:06:06 +0000 (14:06 +0200)
commitdfabf75a4a715524e118ee0c42c1246e565ae886
tree82cbbc2f4a981e3bf02710d5ebf17e92d25e036c
parent6100d0290868c956b155887fde186ca92d8a55a1
iommu/ipmmu-vmsa: Check for error num after setting mask

[ Upstream commit 1fdbbfd5099f797a4dac05e7ef0192ba4a9c39b4 ]

Because of the possible failure of the dma_supported(), the
dma_set_mask_and_coherent() may return error num.
Therefore, it should be better to check it and return the error if
fails.

Fixes: 1c894225bf5b ("iommu/ipmmu-vmsa: IPMMU device is 40-bit bus master")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Link: https://lore.kernel.org/r/20220106024302.2574180-1-jiasheng@iscas.ac.cn
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/ipmmu-vmsa.c