drm/client: Fix memory leak in drm_client_modeset_probe
authorjsg <jsg@openbsd.org>
Fri, 28 Jul 2023 06:37:37 +0000 (06:37 +0000)
committerjsg <jsg@openbsd.org>
Fri, 28 Jul 2023 06:37:37 +0000 (06:37 +0000)
From Jocelyn Falempe
917bef37cfaca07781c6fbaf6cd9404d27e64e6f in linux-6.1.y/6.1.42
2329cc7a101af1a844fbf706c0724c0baea38365 in mainline linux

sys/dev/pci/drm/drm_client_modeset.c

index cd65875..b06459d 100644 (file)
@@ -881,6 +881,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width,
                                break;
                        }
 
+                       kfree(modeset->mode);
                        modeset->mode = drm_mode_duplicate(dev, mode);
                        drm_connector_get(connector);
                        modeset->connectors[modeset->num_connectors++] = connector;