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

Commit 17d492d3 authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Greg Kroah-Hartman
Browse files

drm/nouveau/kms/nv04: use vzalloc for nv04_display



commit bd6e07e72f37f34535bec7eebc807e5fcfe37b43 upstream.

The struct is giant, and triggers an order-7 allocation (512K). There is
no reason for this to be kmalloc-type memory, so switch to vmalloc. This
should help loading nouveau on low-memory and/or long-running systems.

Reported-by: default avatarNathan E. Egge <unlord@xiph.org>
Signed-off-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarKarol Herbst <kherbst@redhat.com>
Signed-off-by: default avatarKarol Herbst <kherbst@redhat.com>
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0d0e56a1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ nv04_display_destroy(struct drm_device *dev)
	nvif_notify_fini(&disp->flip);

	nouveau_display(dev)->priv = NULL;
	kfree(disp);
	vfree(disp);

	nvif_object_unmap(&drm->client.device.object);
}
@@ -197,7 +197,7 @@ nv04_display_create(struct drm_device *dev)
	struct nv04_display *disp;
	int i, ret;

	disp = kzalloc(sizeof(*disp), GFP_KERNEL);
	disp = vzalloc(sizeof(*disp));
	if (!disp)
		return -ENOMEM;