tee: amdtee: fix an IS_ERR() vs NULL bug
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 24 Nov 2021 14:54:04 +0000 (17:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:38 +0000 (09:32 +0100)
commit832f3655c6138c23576ed268e31cc76e0f05f2b1
tree24302057e3e34917bb73bb07d48ff113f73fb71e
parent42d08e97b196479f593499e887a9ab81446a34b9
tee: amdtee: fix an IS_ERR() vs NULL bug

[ Upstream commit 9d7482771fac8d8e38e763263f2ca0ca12dd22c6 ]

The __get_free_pages() function does not return error pointers it returns
NULL so fix this condition to avoid a NULL dereference.

Fixes: 757cc3e9ff1d ("tee: add AMD-TEE driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rijo Thomas <Rijo-john.Thomas@amd.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tee/amdtee/core.c