diff options
| -rw-r--r-- | drivers/char/vt.c | 12 | ||||
| -rw-r--r-- | include/linux/console_struct.h | 1 |
2 files changed, 3 insertions, 10 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 7947bd1b4cf..404f4c1ee43 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
| @@ -770,14 +770,12 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ | |||
| 770 | visual_init(vc, currcons, 1); | 770 | visual_init(vc, currcons, 1); |
| 771 | if (!*vc->vc_uni_pagedir_loc) | 771 | if (!*vc->vc_uni_pagedir_loc) |
| 772 | con_set_default_unimap(vc); | 772 | con_set_default_unimap(vc); |
| 773 | if (!vc->vc_kmalloced) | 773 | vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL); |
| 774 | vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL); | ||
| 775 | if (!vc->vc_screenbuf) { | 774 | if (!vc->vc_screenbuf) { |
| 776 | kfree(vc); | 775 | kfree(vc); |
| 777 | vc_cons[currcons].d = NULL; | 776 | vc_cons[currcons].d = NULL; |
| 778 | return -ENOMEM; | 777 | return -ENOMEM; |
| 779 | } | 778 | } |
| 780 | vc->vc_kmalloced = 1; | ||
| 781 | vc_init(vc, vc->vc_rows, vc->vc_cols, 1); | 779 | vc_init(vc, vc->vc_rows, vc->vc_cols, 1); |
| 782 | vcs_make_sysfs(currcons); | 780 | vcs_make_sysfs(currcons); |
| 783 | atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, ¶m); | 781 | atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, ¶m); |
| @@ -913,10 +911,8 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, | |||
| 913 | if (new_scr_end > new_origin) | 911 | if (new_scr_end > new_origin) |
| 914 | scr_memsetw((void *)new_origin, vc->vc_video_erase_char, | 912 | scr_memsetw((void *)new_origin, vc->vc_video_erase_char, |
| 915 | new_scr_end - new_origin); | 913 | new_scr_end - new_origin); |
| 916 | if (vc->vc_kmalloced) | 914 | kfree(vc->vc_screenbuf); |
| 917 | kfree(vc->vc_screenbuf); | ||
| 918 | vc->vc_screenbuf = newscreen; | 915 | vc->vc_screenbuf = newscreen; |
| 919 | vc->vc_kmalloced = 1; | ||
| 920 | vc->vc_screenbuf_size = new_screen_size; | 916 | vc->vc_screenbuf_size = new_screen_size; |
| 921 | set_origin(vc); | 917 | set_origin(vc); |
| 922 | 918 | ||
| @@ -995,8 +991,7 @@ void vc_deallocate(unsigned int currcons) | |||
| 995 | vc->vc_sw->con_deinit(vc); | 991 | vc->vc_sw->con_deinit(vc); |
| 996 | put_pid(vc->vt_pid); | 992 | put_pid(vc->vt_pid); |
| 997 | module_put(vc->vc_sw->owner); | 993 | module_put(vc->vc_sw->owner); |
| 998 | if (vc->vc_kmalloced) | 994 | kfree(vc->vc_screenbuf); |
| 999 | kfree(vc->vc_screenbuf); | ||
| 1000 | if (currcons >= MIN_NR_CONSOLES) | 995 | if (currcons >= MIN_NR_CONSOLES) |
| 1001 | kfree(vc); | 996 | kfree(vc); |
| 1002 | vc_cons[currcons].d = NULL; | 997 | vc_cons[currcons].d = NULL; |
| @@ -2881,7 +2876,6 @@ static int __init con_init(void) | |||
| 2881 | INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); | 2876 | INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); |
| 2882 | visual_init(vc, currcons, 1); | 2877 | visual_init(vc, currcons, 1); |
| 2883 | vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT); | 2878 | vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT); |
| 2884 | vc->vc_kmalloced = 0; | ||
| 2885 | vc_init(vc, vc->vc_rows, vc->vc_cols, | 2879 | vc_init(vc, vc->vc_rows, vc->vc_cols, |
| 2886 | currcons || !vc->vc_sw->con_save_screen); | 2880 | currcons || !vc->vc_sw->con_save_screen); |
| 2887 | } | 2881 | } |
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index d71f7c0f931..38fe59dc89a 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
| @@ -89,7 +89,6 @@ struct vc_data { | |||
| 89 | unsigned int vc_need_wrap : 1; | 89 | unsigned int vc_need_wrap : 1; |
| 90 | unsigned int vc_can_do_color : 1; | 90 | unsigned int vc_can_do_color : 1; |
| 91 | unsigned int vc_report_mouse : 2; | 91 | unsigned int vc_report_mouse : 2; |
| 92 | unsigned int vc_kmalloced : 1; | ||
| 93 | unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ | 92 | unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ |
| 94 | unsigned char vc_utf_count; | 93 | unsigned char vc_utf_count; |
| 95 | int vc_utf_char; | 94 | int vc_utf_char; |
