Re: [PATCH] drm: simpledrm: fix a potential NULL dereference

2021-05-15 Thread Thomas Zimmermann
Am 15.05.21 um 11:53 schrieb Dan Carpenter: The drm_format_info() function returns NULL if the format is unsupported, but the simplefb_get_validated_format() is expected to return error pointers. If we propagate teh NULL return then it will lead to a NULL dereference in the callers. Swap the

[PATCH] drm: simpledrm: fix a potential NULL dereference

2021-05-15 Thread Dan Carpenter
The drm_format_info() function returns NULL if the format is unsupported, but the simplefb_get_validated_format() is expected to return error pointers. If we propagate teh NULL return then it will lead to a NULL dereference in the callers. Swap the NULL and trade it in for an ERR_PTR(-EINVAL). F