[Mesa-dev] [PATCH] i965: prevent potentially null pointer access
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Fri Feb 9 11:07:14 UTC 2018
Hey Alejandro,
I did that initially but then thought I could have to do it in multiple
places.
If you prefer the check to be in the calling function I can change it.
Thanks,
-
Lionel
On 09/02/18 10:13, Alejandro Piñeiro wrote:
> Is there any reason to not add a fmt check before, so we would prevent
> calling isl_drm_modifier_get_info if not needed?
>
> In any case, that's a nitpick. Just in the case there is a reason, this
> patch:
> Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
>
>
> On 09/02/18 10:57, Lionel Landwerlin wrote:
>> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
>> CID: 1418110
>> ---
>> src/mesa/drivers/dri/i965/intel_screen.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
>> index 1f866cf8459..3f74ee78f37 100644
>> --- a/src/mesa/drivers/dri/i965/intel_screen.c
>> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
>> @@ -315,7 +315,7 @@ modifier_is_supported(const struct gen_device_info *devinfo,
>> int i;
>>
>> /* ISL had better know about the modifier */
>> - if (!modinfo)
>> + if (!fmt || !modinfo)
>> return false;
>>
>> if (modinfo->aux_usage == ISL_AUX_USAGE_CCS_E) {
>
More information about the mesa-dev
mailing list