<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 129.75pt 72.0pt 129.7pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText">> <span lang="EN-US" style="mso-fareast-language:EN-GB">-----Original Message-----</span></p>
<p class="MsoPlainText">> <span lang="EN-US" style="mso-fareast-language:EN-GB">From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf</span></p>
<p class="MsoPlainText">> <span lang="EN-US" style="mso-fareast-language:EN-GB">Of Arun Siluvery</span></p>
<p class="MsoPlainText">> <span lang="EN-US" style="mso-fareast-language:EN-GB">Sent: Monday, November 17, 2014 3:48 PM</span></p>
<p class="MsoPlainText">> <span lang="EN-US" style="mso-fareast-language:EN-GB">To: intel-gfx@lists.freedesktop.org</span></p>
<p class="MsoPlainText">> <span lang="EN-US" style="mso-fareast-language:EN-GB">Subject: [Intel-gfx] [PATCH] drm/i915: Free resources correctly if we cannot</span></p>
<p class="MsoPlainText">> <span lang="EN-US" style="mso-fareast-language:EN-GB">map status page during ctx create</span></p>
<p class="MsoPlainText">> </p>
<p class="MsoPlainText">> We are not freeing memory allocated for ringbuf and ctx if we fail to map</p>
<p class="MsoPlainText">> status page so release all resources correctly.</p>
<p class="MsoPlainText">> </p>
<p class="MsoPlainText">> Signed-off-by: Arun Siluvery <<a href="mailto:arun.siluvery@linux.intel.com"><span style="color:windowtext;text-decoration:none">arun.siluvery@linux.intel.com</span></a>></p>
<p class="MsoPlainText">> ---</p>
<p class="MsoPlainText">> drivers/gpu/drm/i915/intel_lrc.c | 6 ++++--</p>
<p class="MsoPlainText">> 1 file changed, 4 insertions(+), 2 deletions(-)</p>
<p class="MsoPlainText">> </p>
<p class="MsoPlainText">> diff --git a/drivers/gpu/drm/i915/intel_lrc.c</p>
<p class="MsoPlainText">> b/drivers/gpu/drm/i915/intel_lrc.c</p>
<p class="MsoPlainText">> index f3efdbd..a84d24b 100644</p>
<p class="MsoPlainText">> --- a/drivers/gpu/drm/i915/intel_lrc.c</p>
<p class="MsoPlainText">> +++ b/drivers/gpu/drm/i915/intel_lrc.c</p>
<p class="MsoPlainText">> @@ -1777,8 +1777,10 @@ int intel_lr_context_deferred_create(struct</p>
<p class="MsoPlainText">> intel_context *ctx,</p>
<p class="MsoPlainText">> ring->status_page.gfx_addr =</p>
<p class="MsoPlainText">> i915_gem_obj_ggtt_offset(ctx_obj);</p>
<p class="MsoPlainText">> ring->status_page.page_addr =</p>
<p class="MsoPlainText">> kmap(sg_page(ctx_obj->pages->sgl));</p>
<p class="MsoPlainText">> - if (ring->status_page.page_addr == NULL)</p>
<p class="MsoPlainText">> - return -ENOMEM;</p>
<p class="MsoPlainText">> + if (ring->status_page.page_addr == NULL) {</p>
<p class="MsoPlainText">> + ret = -ENOMEM;</p>
<p class="MsoPlainText">> + goto error;</p>
<p class="MsoPlainText">> + }</p>
<p class="MsoPlainText">> ring->status_page.obj = ctx_obj;</p>
<p class="MsoPlainText">> }</p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Hi Arun,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I think your tree is out of date. See this patch:<o:p></o:p></p>
<p class="MsoPlainText"><a href="http://patchwork.freedesktop.org/patch/35828/">http://patchwork.freedesktop.org/patch/35828/</a><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Cheers,<o:p></o:p></p>
<p class="MsoPlainText">Thomas.<o:p></o:p></p>
<p class="MsoPlainText"><span style="color:black"><o:p> </o:p></span></p>
</div>
</body>
</html>