Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Jonathan Cavitt and committed by
Ville Syrjälä
c601fd54 74b6e839

+2 -1
+2 -1
drivers/gpu/drm/drm_client_modeset.c
··· 930 930 mutex_unlock(&client->modeset_mutex); 931 931 out: 932 932 kfree(crtcs); 933 - modes_destroy(dev, modes, connector_count); 933 + if (modes) 934 + modes_destroy(dev, modes, connector_count); 934 935 kfree(modes); 935 936 kfree(offsets); 936 937 kfree(enabled);