From be5fad45ee4e81997784f258fcdfaf0a303dd666 Mon Sep 17 00:00:00 2001 From: vehemens Date: Sat, 6 Sep 2008 18:02:31 -0700 Subject: Free temp_pagelist on error. Free in reverse order. Noticed by open. Signed-off-by: Robert Noland --- bsd-core/drm_bufs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bsd-core') diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index 2570641d..6b31ad65 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -562,8 +562,9 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque if (entry->buflist == NULL || entry->seglist == NULL || temp_pagelist == NULL) { - free(entry->buflist, M_DRM); + free(temp_pagelist, M_DRM); free(entry->seglist, M_DRM); + free(entry->buflist, M_DRM); return ENOMEM; } -- cgit v1.2.3