[patch v2] drm/msm/dsi: free first element on error

Jani Nikula jani.nikula at linux.intel.com
Thu Feb 16 12:27:08 UTC 2017


On Thu, 16 Feb 2017, Rob Clark <robdclark at gmail.com> wrote:
> On Thu, Feb 16, 2017 at 7:00 AM, Dan Carpenter <dan.carpenter at oracle.com> wrote:
>> We're off by one here.  We free something that wasn't allocated and we
>> don't free msm_host->bus_clks[].
>>
>> Fixes: 6e0eb52eba9e ("drm/msm/dsi: Parse bus clocks from a list")
>> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
>
> Thanks
>
> Reviewed-by: Rob Clark <robdclark at gmail.com>

And for good measure,

Reviewed-by: Jani Nikula <jani.nikula at intel.com>


>
>>
>> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
>> index 1fc07ce24686..4fa32296162e 100644
>> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
>> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
>> @@ -437,7 +437,7 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
>>
>>         return 0;
>>  err:
>> -       for (; i > 0; i--)
>> +       while (i--)
>>                 clk_disable_unprepare(msm_host->bus_clks[i]);
>>
>>         return ret;

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the dri-devel mailing list