Re: [PATCH] staging: bcm2835-audio: Fix memory corruption

From: Dan Carpenter
Date: Thu Aug 10 2017 - 07:06:55 EST


On Thu, Aug 10, 2017 at 11:52:42AM +0100, Phil Elwell wrote:
> > This label name is out of date. There is a later error path where
> > vc_vchi_audio_init() fails and we leak on that path.
>
> Also agreed. I'll rework it.
>

Actually I wasn't right. That error path should probably stay how it
is, because we're re-using the vchi_instance. We allocate it in the
first call then re-use it later.

This code is really subtle and ugly.

regards,
dan carpenter