drm/amd/display: invalid parameter check in dmub_hpd_callback
authorjsg <jsg@openbsd.org>
Mon, 1 Aug 2022 16:15:38 +0000 (16:15 +0000)
committerjsg <jsg@openbsd.org>
Mon, 1 Aug 2022 16:15:38 +0000 (16:15 +0000)
From Jose Exposito
f85a6046f7718f11c6ad015a0ba25d897194b1ac in linux 5.15.y/5.15.58
978ffac878fd64039f95798b15b430032d2d89d5 in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 42648e6..a7ec346 100644 (file)
@@ -653,7 +653,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
        struct drm_connector_list_iter iter;
        struct dc_link *link;
        uint8_t link_index = 0;
-       struct drm_device *dev = adev->dm.ddev;
+       struct drm_device *dev;
 
        if (adev == NULL)
                return;
@@ -670,6 +670,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
 
        link_index = notify->link_index;
        link = adev->dm.dc->links[link_index];
+       dev = adev->dm.ddev;
 
        drm_connector_list_iter_begin(dev, &iter);
        drm_for_each_connector_iter(connector, &iter) {