<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 26, 2018, 14:00 Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Jun 26, 2018 at 3:32 AM, Erik Faye-Lund <<a href="mailto:kusmabite@gmail.com" target="_blank" rel="noreferrer">kusmabite@gmail.com</a>> wrote:<br>
> On Wed, Jun 20, 2018 at 3:03 AM Jonathan Marek <<a href="mailto:jonathan@marek.ca" target="_blank" rel="noreferrer">jonathan@marek.ca</a>> wrote:<br>
>><br>
>> Signed-off-by: Jonathan Marek <<a href="mailto:jonathan@marek.ca" target="_blank" rel="noreferrer">jonathan@marek.ca</a>><br>
>> ---<br>
>>  src/gallium/drivers/freedreno/a2xx/fd2_program.c | 2 ++<br>
>>  1 file changed, 2 insertions(+)<br>
>><br>
>> diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_program.c b/src/gallium/drivers/freedreno/a2xx/fd2_program.c<br>
>> index 9a77457251..834a7c7fcd 100644<br>
>> --- a/src/gallium/drivers/freedreno/a2xx/fd2_program.c<br>
>> +++ b/src/gallium/drivers/freedreno/a2xx/fd2_program.c<br>
>> @@ -54,6 +54,8 @@ create_shader(enum shader_t type)<br>
>>  static void<br>
>>  delete_shader(struct fd2_shader_stateobj *so)<br>
>>  {<br>
>> +       if (!so)<br>
>> +               return;<br>
>>         ir2_shader_destroy(so->ir);<br>
>>         free(so->tokens);<br>
>>         free(so->bin);<br>
><br>
> This seems to just put a band-aid on top of some other bug... Wouldn't<br>
> it be better to lift this out to the call-site instead?<br>
<br>
Mmm, then you just end up w/ the null check in two or three different<br>
spots, instead of one..<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I meant in the affected call site, not all. Basically, I was trying to hint that this shouldn't have happened in the first place, and should be fixed where this unexpectedly becomes null... </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I would be a bit curious to see the call-stack of the crash (since I<br>
haven't seen similar issues with a3xx/a4xx/a5xx), but I think putting<br>
the null check here is reasonable.<br>
<br>
BR,<br>
-R<br>
</blockquote></div></div></div>