[Intel-gfx] [PATCH] drm/i915: Free resources correctly if we cannot map status page during ctx create

Siluvery, Arun arun.siluvery at linux.intel.com
Mon Nov 17 16:57:48 CET 2014


On 17/11/2014 15:54, Daniel, Thomas wrote:
>> -----Original Message-----
>
>> From: Intel-gfx [mailto:intel-gfx-bounces at lists.freedesktop.org] On Behalf
>
>> Of Arun Siluvery
>
>> Sent: Monday, November 17, 2014 3:48 PM
>
>> To: intel-gfx at lists.freedesktop.org
>
>> Subject: [Intel-gfx] [PATCH] drm/i915: Free resources correctly if we cannot
>
>> map status page during ctx create
>
>>
>
>> We are not freeing memory allocated for ringbuf and ctx if we fail to map
>
>> status page so release all resources correctly.
>
>>
>
>> Signed-off-by: Arun Siluvery <arun.siluvery at linux.intel.com<mailto:arun.siluvery at linux.intel.com>>
>
>> ---
>
>>   drivers/gpu/drm/i915/intel_lrc.c | 6 ++++--
>
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>
>>
>
>> diff --git a/drivers/gpu/drm/i915/intel_lrc.c
>
>> b/drivers/gpu/drm/i915/intel_lrc.c
>
>> index f3efdbd..a84d24b 100644
>
>> --- a/drivers/gpu/drm/i915/intel_lrc.c
>
>> +++ b/drivers/gpu/drm/i915/intel_lrc.c
>
>> @@ -1777,8 +1777,10 @@ int intel_lr_context_deferred_create(struct
>
>> intel_context *ctx,
>
>>                              ring->status_page.gfx_addr =
>
>> i915_gem_obj_ggtt_offset(ctx_obj);
>
>>                              ring->status_page.page_addr =
>
>>                                                              kmap(sg_page(ctx_obj->pages->sgl));
>
>> -                           if (ring->status_page.page_addr == NULL)
>
>> -                                           return -ENOMEM;
>
>> +                          if (ring->status_page.page_addr == NULL) {
>
>> +                                          ret = -ENOMEM;
>
>> +                                          goto error;
>
>> +                          }
>
>>                              ring->status_page.obj = ctx_obj;
>
>>              }
>
>
>
>
>
> Hi Arun,
>
>
>
> I think your tree is out of date.  See this patch:
>
> http://patchwork.freedesktop.org/patch/35828/
>
>
>
> Cheers,
>
> Thomas.
>
>
You are right, I don't have latest changes.
This patch can be ignored.

regards
Arun




More information about the Intel-gfx mailing list