Commit 359afacc authored by Stefan Wahren's avatar Stefan Wahren Committed by Greg Kroah-Hartman

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: default avatarStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c35c6af
...@@ -2355,6 +2355,11 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero, ...@@ -2355,6 +2355,11 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero,
"%s: slot_zero = %pK, is_master = %d", "%s: slot_zero = %pK, is_master = %d",
__func__, slot_zero, is_master); __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 */ /* Check the input configuration */
if (slot_zero->magic != VCHIQ_MAGIC) { if (slot_zero->magic != VCHIQ_MAGIC) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment