提交 bfaa1ce8 编写于 作者: C Colin Ian King 提交者: Oded Gabbay

drm/amdkfd: check for null dev to avoid a null pointer dereference

The call to kfd_device_by_id can potentially return null, so check that
dev is null and return with -EINVAL to avoid a null pointer dereference.

Detected by CoverityScan CID#1454629 ("Dereference null return value")

Fixes: 5d71dbc3 ("drm/amdkfd: Implement image tiling mode support v2")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NOded Gabbay <oded.gabbay@gmail.com>
上级 56eac98b
......@@ -892,6 +892,8 @@ static int kfd_ioctl_get_tile_config(struct file *filep,
int err = 0;
dev = kfd_device_by_id(args->gpu_id);
if (!dev)
return -EINVAL;
dev->kfd2kgd->get_tile_config(dev->kgd, &config);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册