diff options
author | Stefan Wahren <stefan.wahren@i2se.com> | 2017-05-26 00:26:20 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-29 17:04:12 +0200 |
commit | 359afaccd97e6257bcda29efa4e83375d9a2cc34 (patch) | |
tree | 29f7012d6b221733a20e9bd81a6b9c80fd9a8cd2 /drivers/staging/vc04_services | |
parent | 7c35c6af0cd6896f6e293cf617a5e27116735e5b (diff) |
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>
Diffstat (limited to 'drivers/staging/vc04_services')
-rw-r--r-- | drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index c47de9692c8c..0a46e1525d8c 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -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) { |