Skip to contentSkip to conversation

staging: bcm2835-audio: double free in init error path

PATCH In review Dan Carpenter 2 participants 2 messages Dec 17, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: bcm2835-audio: double free in init error path

We free instance here and in the caller. It should be only the caller which handles it.

Fixes d7ca3a71545b ("staging: bcm2835-audio: Operate non-atomic PCM ops")
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +0 -1
index 0db412fd7c55..c0debdbce26c 100644
@@ -138,7 +138,6 @@ vc_vchi_audio_init(VCHI_INSTANCE_T vchi_instance,
 		dev_err(instance->dev,
 			"failed to open VCHI service connection (status=%d)\n",
 			status);
-		kfree(instance);
 		return -EPERM;
 	}
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

We free instance here and in the caller. It should be only the caller which handles it.

Fixes d7ca3a71545b ("staging: bcm2835-audio: Operate non-atomic PCM ops")

thanks,

Takashi

Quoted 19 lines
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +0 -1
index 0db412fd7c55..c0debdbce26c 100644
@@ -138,7 +138,6 @@ vc_vchi_audio_init(VCHI_INSTANCE_T vchi_instance,
 		dev_err(instance->dev,
 			"failed to open VCHI service connection (status=%d)\n",
 			status);
-		kfree(instance);
 		return -EPERM;
 	}
 
Signature · 1 line
2.17.1