]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/client: Do not destroy NULL modes
authorJonathan Cavitt <jonathan.cavitt@intel.com>
Tue, 24 Feb 2026 22:12:28 +0000 (22:12 +0000)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 25 Feb 2026 07:31:54 +0000 (09:31 +0200)
commitc601fd5414315fc515f746b499110e46272e7243
treed01b73deee1ec447d5a1581024f1163194f3d350
parent74b6e83942dcc9f3cca9e561b205a5b19940a344
drm/client: Do not destroy NULL modes

'modes' in drm_client_modeset_probe may fail to kcalloc.  If this
occurs, we jump to 'out', calling modes_destroy on it, which
dereferences it.  This may result in a NULL pointer dereference in the
error case.  Prevent that.

Fixes: 3039cc0c0653 ("drm/client: Make copies of modes")
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260224221227.69126-2-jonathan.cavitt@intel.com
drivers/gpu/drm/drm_client_modeset.c