Re: [PATCH] drm/i915/gt: Prevent possible NULL dereference in __caps_show()

2024-02-09 Thread Nikita Zhandarovich
Hello, On 2/7/24 01:16, Tvrtko Ursulin wrote: > > Hi, > > On 06/02/2024 16:45, Nikita Zhandarovich wrote: >> After falling through the switch statement to default case 'repr' is >> initialized with NULL, which will lead to incorrect dereference of >> '!repr[n]' in the following loop. >> >> Fix i

[PATCH] drm/i915/gt: Prevent possible NULL dereference in __caps_show()

2024-02-09 Thread Nikita Zhandarovich
After falling through the switch statement to default case 'repr' is initialized with NULL, which will lead to incorrect dereference of '!repr[n]' in the following loop. Fix it with the help of an additional check for NULL. Found by Linux Verification Center (linuxtesting.org) with static analysi

Re: [PATCH] drm/i915/gt: Prevent possible NULL dereference in __caps_show()

2024-02-07 Thread Tvrtko Ursulin
Hi, On 06/02/2024 16:45, Nikita Zhandarovich wrote: After falling through the switch statement to default case 'repr' is initialized with NULL, which will lead to incorrect dereference of '!repr[n]' in the following loop. Fix it with the help of an additional check for NULL. Found by Linux V