Skip to content

Commit 9930f51

Browse files
committed
Merge tag 'drm-misc-fixes-2023-06-16' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
drm-misc-fixes maybe in time for v6.4-rc7: - qaic leak and null deref fix. - Fix runtime pm in nouveau. - Fix array overflow in ti-sn65dsi86 pwm chip handling. - Assorted null check fixes in nouveau. Signed-off-by: Dave Airlie <[email protected]> From: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents c8a5d5e + 55b94bb commit 9930f51

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

drivers/accel/qaic/qaic_drv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ static int qaic_open(struct drm_device *dev, struct drm_file *file)
9797

9898
cleanup_usr:
9999
cleanup_srcu_struct(&usr->qddev_lock);
100+
ida_free(&qaic_usrs, usr->handle);
100101
free_usr:
101102
kfree(usr);
102103
dev_unlock:
@@ -224,6 +225,9 @@ static void qaic_destroy_drm_device(struct qaic_device *qdev, s32 partition_id)
224225
struct qaic_user *usr;
225226

226227
qddev = qdev->qddev;
228+
qdev->qddev = NULL;
229+
if (!qddev)
230+
return;
227231

228232
/*
229233
* Existing users get unresolvable errors till they close FDs.

drivers/gpu/drm/bridge/ti-sn65dsi86.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ static void ti_sn_bridge_set_refclk_freq(struct ti_sn65dsi86 *pdata)
298298
if (refclk_lut[i] == refclk_rate)
299299
break;
300300

301+
/* avoid buffer overflow and "1" is the default rate in the datasheet. */
302+
if (i >= refclk_lut_size)
303+
i = 1;
304+
301305
regmap_update_bits(pdata->regmap, SN_DPPLL_SRC_REG, REFCLK_FREQ_MASK,
302306
REFCLK_FREQ(i));
303307

drivers/gpu/drm/nouveau/nouveau_acpi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out
220220
int optimus_funcs;
221221
struct pci_dev *parent_pdev;
222222

223+
if (pdev->vendor != PCI_VENDOR_ID_NVIDIA)
224+
return;
225+
223226
*has_pr3 = false;
224227
parent_pdev = pci_upstream_bridge(pdev);
225228
if (parent_pdev) {

drivers/gpu/drm/nouveau/nouveau_connector.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,8 @@ nouveau_connector_detect_lvds(struct drm_connector *connector, bool force)
730730
#endif
731731

732732
nouveau_connector_set_edid(nv_connector, edid);
733-
nouveau_connector_set_encoder(connector, nv_encoder);
733+
if (nv_encoder)
734+
nouveau_connector_set_encoder(connector, nv_encoder);
734735
return status;
735736
}
736737

@@ -966,7 +967,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
966967
/* Determine display colour depth for everything except LVDS now,
967968
* DP requires this before mode_valid() is called.
968969
*/
969-
if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS)
970+
if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
970971
nouveau_connector_detect_depth(connector);
971972

972973
/* Find the native mode if this is a digital panel, if we didn't
@@ -987,7 +988,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
987988
* "native" mode as some VBIOS tables require us to use the
988989
* pixel clock as part of the lookup...
989990
*/
990-
if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)
991+
if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
991992
nouveau_connector_detect_depth(connector);
992993

993994
if (nv_encoder->dcb->type == DCB_OUTPUT_TV)

0 commit comments

Comments
 (0)