Skip to content

Commit

Permalink
Fixed some coverity issues
Browse files Browse the repository at this point in the history
* Double free
* Double close

Tracked-On: OAM-129205
Signed-off-by: manxiaoliang <[email protected]>
  • Loading branch information
manxiaoliang committed Feb 19, 2025
1 parent 455f216 commit c4ffd6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions cros_gralloc/cros_gralloc_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ cros_gralloc_driver::cros_gralloc_driver(): drivers_(GPU_GRP_TYPE_NR, nullptr)

// hit any of undesired render node
if (j < ARRAY_SIZE(undesired)) {
drmFreeVersion(version);
close(fd);
continue;
}

Expand Down
2 changes: 2 additions & 0 deletions xe.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ static int xe_init(struct driver *drv)

if (!xe_query_device_info(drv, xe)) {
drv_loge("Failed to query device id using DRM_IOCTL_XE_DEVICE_QUERY");
if (!xe)
free(xe);
return -EINVAL;
}

Expand Down

0 comments on commit c4ffd6a

Please sign in to comment.