mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
staging: vchiq_core: Bailout if VCHIQ state is already initialized
In case VCHIQ state is already initialized we need to bailout in order to aovid a memory leak. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7c35c6af0c
commit
359afaccd9
@ -2355,6 +2355,11 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero,
|
||||
"%s: slot_zero = %pK, is_master = %d",
|
||||
__func__, slot_zero, is_master);
|
||||
|
||||
if (vchiq_states[0]) {
|
||||
pr_err("%s: VCHIQ state already initialized\n", __func__);
|
||||
return VCHIQ_ERROR;
|
||||
}
|
||||
|
||||
/* Check the input configuration */
|
||||
|
||||
if (slot_zero->magic != VCHIQ_MAGIC) {
|
||||
|
Loading…
Reference in New Issue
Block a user