From: Thomas Zimmermann Date: Fri, 7 Mar 2025 08:36:53 +0000 (+0100) Subject: drm/appletbdrm: Fix ref-counting on dmadev X-Git-Tag: v6.15-rc1~120^2~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=914ee6e730e134410b77edc453b629767e84c32c;p=thirdparty%2Flinux.git drm/appletbdrm: Fix ref-counting on dmadev Remove the put_device() call on dmadev. The driver sets the field without getting a reference, so it shouldn't put a reference either. The dmadev field points to the regular USB device for which DRM maintains a reference internally. Hence dmadev will not become dangling during the DRM device's lifetime. Signed-off-by: Thomas Zimmermann Fixes: 0670c2f56e45 ("drm/tiny: add driver for Apple Touch Bars in x86 Macs") Cc: Aditya Garg Cc: Aun-Ali Zaidi Cc: dri-devel@lists.freedesktop.org Acked-by: Aditya Garg Link: https://patchwork.freedesktop.org/patch/msgid/20250307083702.142675-1-tzimmermann@suse.de --- diff --git a/drivers/gpu/drm/tiny/appletbdrm.c b/drivers/gpu/drm/tiny/appletbdrm.c index 394c8f9bd41ab..4370ba22dd883 100644 --- a/drivers/gpu/drm/tiny/appletbdrm.c +++ b/drivers/gpu/drm/tiny/appletbdrm.c @@ -805,7 +805,6 @@ static void appletbdrm_disconnect(struct usb_interface *intf) struct appletbdrm_device *adev = usb_get_intfdata(intf); struct drm_device *drm = &adev->drm; - put_device(adev->dmadev); drm_dev_unplug(drm); drm_atomic_helper_shutdown(drm); }