summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJerzy Kasenberg <[email protected]>2020-08-25 14:30:02 +0200
committerJerzy Kasenberg <[email protected]>2020-08-25 14:35:05 +0200
commita3eff0c51a8b5ad58fa7111e770e3b5b3d959351 (patch)
treeb27b145dd036056d68eb654864758ef04c306051 /src
parenta4c096be377dd57554a67db92dd3d3167475c142 (diff)
audio_device: Fix NULL pointer access in audiod_xfer_cb
b_bytes_copied was pointer with NULL value instead of plain variable. NULL pointer was passed to audio_tx_done_cb() and dereference as well. Now variable is not a pointer.
Diffstat (limited to 'src')
-rw-r--r--src/class/audio/audio_device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/class/audio/audio_device.c b/src/class/audio/audio_device.c
index 1f2660825..cbb13afc9 100644
--- a/src/class/audio/audio_device.c
+++ b/src/class/audio/audio_device.c
@@ -1002,10 +1002,10 @@ bool audiod_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint3
// This is the only place where we can fill something into the EPs buffer!
// Load new data
- uint16_t *n_bytes_copied = NULL;
- TU_VERIFY(audio_tx_done_cb(rhport, &_audiod_itf[idxDriver], n_bytes_copied));
+ uint16_t n_bytes_copied;
+ TU_VERIFY(audio_tx_done_cb(rhport, &_audiod_itf[idxDriver], &n_bytes_copied));
- if (*n_bytes_copied == 0)
+ if (n_bytes_copied == 0)
{
// Load with ZLP
return usbd_edpt_xfer(rhport, ep_addr, NULL, 0);