[PATCH V3] drm/xe/guc: Fix dereference before NULL check

Dong, Zhanjun zhanjun.dong at intel.com
Tue Oct 15 14:41:19 UTC 2024


With the "Fixes" tag fixed, looks good to me to make Coverity happy.

Reviewed-by: Zhanjun Dong <zhanjun.dong at intel.com>

Regards,
Zhanjun Dong

On 2024-10-10 5:33 a.m., Michal Wajdeczko wrote:
> 
> 
> On 10.10.2024 08:54, Dan Carpenter wrote:
>> On Thu, Oct 10, 2024 at 12:46:34AM -0600, Everest K.C. wrote:
>>> The pointer list->list is dereferenced before the NULL check.
>>> Fix this by moving the NULL check outside the for loop, so that
>>> the check is performed before the dereferencing.
>>> The list->list pointer cannot be NULL so this has no effect on runtime.
>>> It's just a correctness issue.
>>>
>>> This issue was reported by Coverity Scan.
>>> https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600335
>>>
>>> Fixes: a18c696fa5cb ("drm/xe/guc: Fix dereference before Null check")
> 
> hmm, this seems wrong, shouldn't this be:
> 
> Fixes: 0f1fdf559225 ("drm/xe/guc: Save manual engine capture into
> capture list")
> 
>>> Signed-off-by: Everest K.C. <everestkc at everestkc.com.np>
>>> ---
>>
>> Perfect!  Thanks.
>>
>> Reviewed-by: Dan Carpenter <dan.carpenter at linaro.org>
>>
>> regards,
>> dan carpenter
>>
> 


More information about the Intel-xe mailing list