Skip to content

Commit 48d625e

Browse files
Colin Ian Kingherbertx
authored andcommitted
tee: fix memory allocation failure checks on drv_data and amdtee
Currently the memory allocation failure checks on drv_data and amdtee are using IS_ERR rather than checking for a null pointer. Fix these checks to use the conventional null pointer check. Addresses-Coverity: ("Dereference null return") Fixes: 757cc3e ("tee: add AMD-TEE driver") Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Rijo Thomas <[email protected]> Acked-by: Jens Wiklander <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 38c0d0a commit 48d625e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tee/amdtee/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,11 @@ static int __init amdtee_driver_init(void)
446446
}
447447

448448
drv_data = kzalloc(sizeof(*drv_data), GFP_KERNEL);
449-
if (IS_ERR(drv_data))
449+
if (!drv_data)
450450
return -ENOMEM;
451451

452452
amdtee = kzalloc(sizeof(*amdtee), GFP_KERNEL);
453-
if (IS_ERR(amdtee)) {
453+
if (!amdtee) {
454454
rc = -ENOMEM;
455455
goto err_kfree_drv_data;
456456
}

0 commit comments

Comments
 (0)