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/log: Add free callback

Free the client memory in the client free callback. Also move the
debugging output into the free callback: drm_client_release() puts
the reference on the DRM device, so pointers to the device should
be considered dangling afterwards.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>>
Link: https://lore.kernel.org/r/20251009132006.45834-4-tzimmermann@suse.de

+11 -3
+11 -3
drivers/gpu/drm/clients/drm_log.c
··· 293 293 } 294 294 } 295 295 296 - static void drm_log_client_unregister(struct drm_client_dev *client) 296 + static void drm_log_client_free(struct drm_client_dev *client) 297 297 { 298 298 struct drm_log *dlog = client_to_drm_log(client); 299 299 struct drm_device *dev = client->dev; 300 + 301 + kfree(dlog); 302 + 303 + drm_dbg(dev, "Unregistered with drm log\n"); 304 + } 305 + 306 + static void drm_log_client_unregister(struct drm_client_dev *client) 307 + { 308 + struct drm_log *dlog = client_to_drm_log(client); 300 309 301 310 unregister_console(&dlog->con); 302 311 ··· 313 304 drm_log_free_scanout(client); 314 305 mutex_unlock(&dlog->lock); 315 306 drm_client_release(client); 316 - kfree(dlog); 317 - drm_dbg(dev, "Unregistered with drm log\n"); 318 307 } 319 308 320 309 static int drm_log_client_hotplug(struct drm_client_dev *client) ··· 346 339 347 340 static const struct drm_client_funcs drm_log_client_funcs = { 348 341 .owner = THIS_MODULE, 342 + .free = drm_log_client_free, 349 343 .unregister = drm_log_client_unregister, 350 344 .hotplug = drm_log_client_hotplug, 351 345 .suspend = drm_log_client_suspend,