We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3db42c7 commit ad9bb8fCopy full SHA for ad9bb8f
drivers/s390/char/sclp_tty.c
@@ -490,6 +490,17 @@ static const struct tty_operations sclp_ops = {
490
.flush_buffer = sclp_tty_flush_buffer,
491
};
492
493
+/* Release allocated pages. */
494
+static void __init __sclp_tty_free_pages(void)
495
+{
496
+ struct list_head *page, *p;
497
+
498
+ list_for_each_safe(page, p, &sclp_tty_pages) {
499
+ list_del(page);
500
+ free_page((unsigned long)page);
501
+ }
502
+}
503
504
static int __init
505
sclp_tty_init(void)
506
{
@@ -516,6 +527,7 @@ sclp_tty_init(void)
516
527
for (i = 0; i < MAX_KMEM_PAGES; i++) {
517
528
page = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
518
529
if (page == NULL) {
530
+ __sclp_tty_free_pages();
519
531
tty_driver_kref_put(driver);
520
532
return -ENOMEM;
521
533
}
0 commit comments