Skip to content

Commit

Permalink
stlinkv3/usb_f723: Removed some unnecessary casts on the callback fun…
Browse files Browse the repository at this point in the history
…ction pointers which trigger UB
  • Loading branch information
dragonmux committed Dec 22, 2024
1 parent 610f26d commit 7f493a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platforms/stlinkv3/usb_f723.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static void stm32f723_ep_setup(usbd_device *usbd_dev, uint8_t addr, uint8_t type
OTG_DIEPCTL0_SNAK | (type << 18) | OTG_DIEPCTL0_USBAEP | OTG_DIEPCTLX_SD0PID | (addr << 22) | max_size;

if (callback)
usbd_dev->user_callback_ctr[addr][USB_TRANSACTION_IN] = (void *)callback;
usbd_dev->user_callback_ctr[addr][USB_TRANSACTION_IN] = callback;
}

if (!dir) {
Expand All @@ -218,7 +218,7 @@ static void stm32f723_ep_setup(usbd_device *usbd_dev, uint8_t addr, uint8_t type
(type << 18) | max_size;

if (callback)
usbd_dev->user_callback_ctr[addr][USB_TRANSACTION_OUT] = (void *)callback;
usbd_dev->user_callback_ctr[addr][USB_TRANSACTION_OUT] = callback;
}
}

Expand Down

0 comments on commit 7f493a2

Please sign in to comment.