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

Commit f1048765 authored by Julia Lawall's avatar Julia Lawall Committed by Dave Airlie
Browse files

drivers/gpu/drm/savage/savage_state.c: add missing kfree



Most of the error handling code in this function frees the buffers
kcmd_addr, kvb_addr, and kbox_addr allocated at the beginning of this
function.  These two branches are changed to do the same.

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent f48bb04a
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1057,7 +1057,8 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_
				DRM_ERROR("indexed drawing command extends "
				DRM_ERROR("indexed drawing command extends "
					  "beyond end of command buffer\n");
					  "beyond end of command buffer\n");
				DMA_FLUSH();
				DMA_FLUSH();
				return -EINVAL;
				ret = -EINVAL;
				goto done;
			}
			}
			/* fall through */
			/* fall through */
		case SAVAGE_CMD_DMA_PRIM:
		case SAVAGE_CMD_DMA_PRIM:
@@ -1076,7 +1077,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_
				      cmdbuf->vb_stride,
				      cmdbuf->vb_stride,
				      cmdbuf->nbox, cmdbuf->box_addr);
				      cmdbuf->nbox, cmdbuf->box_addr);
				if (ret != 0)
				if (ret != 0)
					return ret;
					goto done;
				first_draw_cmd = NULL;
				first_draw_cmd = NULL;
			}
			}
		}
		}