mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
__destroy_component_cfg() is called to free the configuration array.
It uses the embedded 'garbage' structure, which means the array has
to be allocated.
If __destroy_component_cfg() is called from mpam_disable() before the
configuration was ever allocated, then a NULL pointer is dereferenced.
Check for this case and return early if the configuration is not
allocated.
__destroy_component_cfg() also frees the mbwu_state as this is allocated
by __allocate_component_cfg(). As the mbwu_state is allocated after
comp->cfg is set, and is also under mpam_list_lock, only the first
pointer needs checking.
Fixes:
|
||
|---|---|---|
| .. | ||
| Kconfig | ||
| Makefile | ||
| mpam_devices.c | ||
| mpam_internal.h | ||
| mpam_resctrl.c | ||
| test_mpam_devices.c | ||
| test_mpam_resctrl.c | ||