Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65aa2f4e authored by Darren Jenkins's avatar Darren Jenkins Committed by Dave Airlie
Browse files

gpu/drm/radeon/radeon_irq.c: move a dereference below a NULL test



If a NULL value is possible, the dereference should only occur after the
NULL test.

Coverity CID: 13338

Signed-off-by: default avatarDarren Jenkins <darrenrjenkins@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 875c1866
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -289,16 +289,16 @@ int radeon_irq_emit(struct drm_device *dev, void *data, struct drm_file *file_pr
	drm_radeon_irq_emit_t *emit = data;
	drm_radeon_irq_emit_t *emit = data;
	int result;
	int result;


	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
		return -EINVAL;

	LOCK_TEST_WITH_RETURN(dev, file_priv);

	if (!dev_priv) {
	if (!dev_priv) {
		DRM_ERROR("called with no initialization\n");
		DRM_ERROR("called with no initialization\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


	if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600)
		return -EINVAL;

	LOCK_TEST_WITH_RETURN(dev, file_priv);

	result = radeon_emit_irq(dev);
	result = radeon_emit_irq(dev);


	if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) {
	if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) {