Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERNAL:Fix Coverity issues #102

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cros_gralloc/cros_gralloc_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int32_t cros_gralloc_driver::init()
}

node_fd[availabe_node] = fd;
strcpy(node_name[availabe_node], version->name);
strncpy(node_name[availabe_node], version->name, name_length);
availabe_node++;

drmFreeVersion(version);
Expand Down
8 changes: 4 additions & 4 deletions cros_gralloc/gralloc1/cros_gralloc1_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,15 @@ int32_t CrosGralloc1::lock(buffer_handle_t bufferHandle, gralloc1_producer_usage
auto error = retain(buffer_handle);
if (error != GRALLOC1_ERROR_NONE) {
drv_log("Retain failed");
delete buffer_handle;
free(const_cast<native_handle_t*>(buffer_handle));
return error;
}
bufferHandle = buffer_handle;
if (driver->lock(bufferHandle, acquireFence, map_flags, addr)) {
drv_log("lock failed");
return CROS_GRALLOC_ERROR_BAD_HANDLE;
}
delete buffer_handle;
free(const_cast<native_handle_t*>(buffer_handle));
}

*outData = addr[0];
Expand Down Expand Up @@ -575,7 +575,7 @@ int32_t CrosGralloc1::lockYCbCr(buffer_handle_t bufferHandle,
auto error = retain(buffer_handle);
if (error != GRALLOC1_ERROR_NONE) {
drv_log("Retain failed");
delete buffer_handle;
free(const_cast<native_handle_t*>(buffer_handle));
return error;
}
bufferHandle = buffer_handle;
Expand All @@ -584,7 +584,7 @@ int32_t CrosGralloc1::lockYCbCr(buffer_handle_t bufferHandle,
return CROS_GRALLOC_ERROR_BAD_HANDLE;
}
driver->release(buffer_handle);
delete buffer_handle;
free(const_cast<native_handle_t*>(buffer_handle));
}

switch (hnd->format) {
Expand Down
4 changes: 2 additions & 2 deletions i915.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ static int i915_add_combinations(struct driver *drv)
static int i915_align_dimensions(struct bo *bo, uint32_t tiling, uint32_t *stride,
uint32_t *aligned_height)
{
uint32_t horizontal_alignment;
uint32_t vertical_alignment;
uint32_t horizontal_alignment = 64;
uint32_t vertical_alignment = 4;
struct i915_device *i915 = bo->drv->priv;
if (i915->genx10 >= 125) {
horizontal_alignment = 4;
Expand Down
Loading