Skip to content

Commit a7735b4

Browse files
WhatAmISupposedToPutHeregregkh
authored andcommitted
drm/appletbdrm: Use kvzalloc for big allocations
commit aaaa684 upstream. This driver is attached to a ~2000x80 screen, which is a lot more than a single page. This causes out of memory errors in some rare cases. Reported-by: soopyc <cassie@soopy.moe> Closes: t2linux/fedora#51 Signed-off-by: Sasha Finkelstein <k@chaosmail.tech> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Aditya Garg <gargaditya08@live.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 0670c2f ("drm/tiny: add driver for Apple Touch Bars in x86 Macs") Cc: <stable@vger.kernel.org> # v6.15+ Link: https://patch.msgid.link/20260420-x86-tb-vmalloc-v1-1-7757ff657223@chaosmail.tech Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1a17ea9 commit a7735b4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/tiny/appletbdrm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int appletbdrm_primary_plane_helper_atomic_check(struct drm_plane *plane,
353353
frames_size +
354354
sizeof(struct appletbdrm_fb_request_footer), 16);
355355

356-
appletbdrm_state->request = kzalloc(request_size, GFP_KERNEL);
356+
appletbdrm_state->request = kvzalloc(request_size, GFP_KERNEL);
357357

358358
if (!appletbdrm_state->request)
359359
return -ENOMEM;
@@ -543,7 +543,7 @@ static void appletbdrm_primary_plane_destroy_state(struct drm_plane *plane,
543543
{
544544
struct appletbdrm_plane_state *appletbdrm_state = to_appletbdrm_plane_state(state);
545545

546-
kfree(appletbdrm_state->request);
546+
kvfree(appletbdrm_state->request);
547547
kfree(appletbdrm_state->response);
548548

549549
__drm_gem_destroy_shadow_plane_state(&appletbdrm_state->base);

0 commit comments

Comments
 (0)