Unverified Commit b97eaf84 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10598 drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_hd_modes

parents cf320507 534ddad2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -257,6 +257,8 @@ static int nv17_tv_get_hd_modes(struct drm_encoder *encoder,
		if (modes[i].hdisplay == output_mode->hdisplay &&
		    modes[i].vdisplay == output_mode->vdisplay) {
			mode = drm_mode_duplicate(encoder->dev, output_mode);
			if (!mode)
				continue;
			mode->type |= DRM_MODE_TYPE_PREFERRED;

		} else {
@@ -264,6 +266,8 @@ static int nv17_tv_get_hd_modes(struct drm_encoder *encoder,
					    modes[i].vdisplay, 60, false,
					    (output_mode->flags &
					     DRM_MODE_FLAG_INTERLACE), false);
			if (!mode)
				continue;
		}

		/* CVT modes are sometimes unsuitable... */