Re: [PATCH] drm/meson: fix memory leak on ->hpd_notify callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 15 Sep 2023, Neil Armstrong <neil.armstrong@xxxxxxxxxx> wrote:
> On 14/09/2023 15:10, Jani Nikula wrote:
>> The EDID returned by drm_bridge_get_edid() needs to be freed.
>> 
>> Fixes: 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
>> Cc: Neil Armstrong <narmstrong@xxxxxxxxxxxx>
>> Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
>> Cc: Martin Blumenstingl <martin.blumenstingl@xxxxxxxxxxxxxx>
>> Cc: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
>> Cc: Kevin Hilman <khilman@xxxxxxxxxxxx>
>> Cc: Jerome Brunet <jbrunet@xxxxxxxxxxxx>
>> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
>> Cc: linux-amlogic@xxxxxxxxxxxxxxxxxxx
>> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
>> Cc: <stable@xxxxxxxxxxxxxxx> # v5.17+
>> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
>> 
>> ---
>> 
>> UNTESTED
>> ---
>>   drivers/gpu/drm/meson/meson_encoder_hdmi.c | 2 ++
>>   1 file changed, 2 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
>> index 9913971fa5d2..25ea76558690 100644
>> --- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
>> +++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
>> @@ -334,6 +334,8 @@ static void meson_encoder_hdmi_hpd_notify(struct drm_bridge *bridge,
>>   			return;
>>   
>>   		cec_notifier_set_phys_addr_from_edid(encoder_hdmi->cec_notifier, edid);
>> +
>> +		kfree(edid);
>>   	} else
>>   		cec_notifier_phys_addr_invalidate(encoder_hdmi->cec_notifier);
>>   }
>
> Reviewed-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>

Thanks. I don't seem to have a toolchain to get this to build... would
you mind applying this, please?

BR,
Jani.


-- 
Jani Nikula, Intel



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux