HomeFreeBSD

Fix undefined behaviour in the USB controllers

Description

Fix undefined behaviour in the USB controllers

The USB controller drivers assume they can cast a NULL pointer to a
struct and find the address of a member. KUBSan complains about this so
replace with the offsetof and containerof macros that use either a
builtin function where available, or the same NULL pointer on older
compilers without the builtin.

Reviewers: hselasky

Subscribers: imp

Reviewed by: hselasky
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33865

Details

Provenance
andrewAuthored on Dec 29 2021, 12:10 PM
Reviewer
hselasky
Differential Revision
D33865: Fix undefined behaviour in the USB controllers
Parents
rGdfb1c97ab973: mmc_da: remove write-only local variables
Branches
Unknown
Tags
Unknown