Skip to content

Commit

Permalink
Fix Coverity Issues
Browse files Browse the repository at this point in the history
This patches fixes below coverity issues
1> Waiting while holding a lock
2> Unused value

Tracked-On: OAM-112450
Signed-off-by: Padmashree Mandri <[email protected]>
  • Loading branch information
padmashree9110 committed Feb 20, 2024
1 parent a4a679c commit 280f447
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion primary/audio_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,11 +1021,11 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
memset(buffer, 0, bytes);

exit:
pthread_mutex_unlock(&in->lock);
if (ret < 0)
usleep(bytes * 1000000 / audio_stream_in_frame_size(stream) /
in_get_sample_rate(&stream->common));

pthread_mutex_unlock(&in->lock);
return bytes;
}

Expand Down
1 change: 0 additions & 1 deletion usb/audio_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,6 @@ static int adev_open_output_stream(struct audio_hw_device *hw_dev,
proxy_config.rate = config->sample_rate;
} else {
proxy_config.rate = config->sample_rate = profile_get_default_sample_rate(out->profile);
ret = -EINVAL;
}

out->adev->device_sample_rate = config->sample_rate;
Expand Down

0 comments on commit 280f447

Please sign in to comment.