@@ -484,7 +484,7 @@ static int vt_k_ioctl(struct tty_struct *tty, unsigned int cmd,
484
484
return 0 ;
485
485
}
486
486
487
- static inline int do_fontx_ioctl (int cmd ,
487
+ static inline int do_fontx_ioctl (struct vc_data * vc , int cmd ,
488
488
struct consolefontdesc __user * user_cfd ,
489
489
struct console_font_op * op )
490
490
{
@@ -502,28 +502,28 @@ static inline int do_fontx_ioctl(int cmd,
502
502
op -> height = cfdarg .charheight ;
503
503
op -> charcount = cfdarg .charcount ;
504
504
op -> data = cfdarg .chardata ;
505
- return con_font_op (vc_cons [fg_console ].d , op );
506
- case GIO_FONTX : {
505
+ return con_font_op (vc , op );
506
+
507
+ case GIO_FONTX :
507
508
op -> op = KD_FONT_OP_GET ;
508
509
op -> flags = KD_FONT_FLAG_OLD ;
509
510
op -> width = 8 ;
510
511
op -> height = cfdarg .charheight ;
511
512
op -> charcount = cfdarg .charcount ;
512
513
op -> data = cfdarg .chardata ;
513
- i = con_font_op (vc_cons [ fg_console ]. d , op );
514
+ i = con_font_op (vc , op );
514
515
if (i )
515
516
return i ;
516
517
cfdarg .charheight = op -> height ;
517
518
cfdarg .charcount = op -> charcount ;
518
519
if (copy_to_user (user_cfd , & cfdarg , sizeof (struct consolefontdesc )))
519
520
return - EFAULT ;
520
521
return 0 ;
521
- }
522
522
}
523
523
return - EINVAL ;
524
524
}
525
525
526
- static int vt_io_fontreset (struct console_font_op * op )
526
+ static int vt_io_fontreset (struct vc_data * vc , struct console_font_op * op )
527
527
{
528
528
int ret ;
529
529
@@ -537,12 +537,12 @@ static int vt_io_fontreset(struct console_font_op *op)
537
537
538
538
op -> op = KD_FONT_OP_SET_DEFAULT ;
539
539
op -> data = NULL ;
540
- ret = con_font_op (vc_cons [ fg_console ]. d , op );
540
+ ret = con_font_op (vc , op );
541
541
if (ret )
542
542
return ret ;
543
543
544
544
console_lock ();
545
- con_set_default_unimap (vc_cons [ fg_console ]. d );
545
+ con_set_default_unimap (vc );
546
546
console_unlock ();
547
547
548
548
return 0 ;
@@ -584,7 +584,7 @@ static int vt_io_ioctl(struct vc_data *vc, unsigned int cmd, void __user *up,
584
584
op .height = 0 ;
585
585
op .charcount = 256 ;
586
586
op .data = up ;
587
- return con_font_op (vc_cons [ fg_console ]. d , & op );
587
+ return con_font_op (vc , & op );
588
588
589
589
case GIO_FONT :
590
590
op .op = KD_FONT_OP_GET ;
@@ -593,7 +593,7 @@ static int vt_io_ioctl(struct vc_data *vc, unsigned int cmd, void __user *up,
593
593
op .height = 32 ;
594
594
op .charcount = 256 ;
595
595
op .data = up ;
596
- return con_font_op (vc_cons [ fg_console ]. d , & op );
596
+ return con_font_op (vc , & op );
597
597
598
598
case PIO_CMAP :
599
599
if (!perm )
@@ -609,13 +609,13 @@ static int vt_io_ioctl(struct vc_data *vc, unsigned int cmd, void __user *up,
609
609
610
610
fallthrough ;
611
611
case GIO_FONTX :
612
- return do_fontx_ioctl (cmd , up , & op );
612
+ return do_fontx_ioctl (vc , cmd , up , & op );
613
613
614
614
case PIO_FONTRESET :
615
615
if (!perm )
616
616
return - EPERM ;
617
617
618
- return vt_io_fontreset (& op );
618
+ return vt_io_fontreset (vc , & op );
619
619
620
620
case PIO_SCRNMAP :
621
621
if (!perm )
@@ -1066,8 +1066,9 @@ struct compat_consolefontdesc {
1066
1066
};
1067
1067
1068
1068
static inline int
1069
- compat_fontx_ioctl (int cmd , struct compat_consolefontdesc __user * user_cfd ,
1070
- int perm , struct console_font_op * op )
1069
+ compat_fontx_ioctl (struct vc_data * vc , int cmd ,
1070
+ struct compat_consolefontdesc __user * user_cfd ,
1071
+ int perm , struct console_font_op * op )
1071
1072
{
1072
1073
struct compat_consolefontdesc cfdarg ;
1073
1074
int i ;
@@ -1085,15 +1086,16 @@ compat_fontx_ioctl(int cmd, struct compat_consolefontdesc __user *user_cfd,
1085
1086
op -> height = cfdarg .charheight ;
1086
1087
op -> charcount = cfdarg .charcount ;
1087
1088
op -> data = compat_ptr (cfdarg .chardata );
1088
- return con_font_op (vc_cons [fg_console ].d , op );
1089
+ return con_font_op (vc , op );
1090
+
1089
1091
case GIO_FONTX :
1090
1092
op -> op = KD_FONT_OP_GET ;
1091
1093
op -> flags = KD_FONT_FLAG_OLD ;
1092
1094
op -> width = 8 ;
1093
1095
op -> height = cfdarg .charheight ;
1094
1096
op -> charcount = cfdarg .charcount ;
1095
1097
op -> data = compat_ptr (cfdarg .chardata );
1096
- i = con_font_op (vc_cons [ fg_console ]. d , op );
1098
+ i = con_font_op (vc , op );
1097
1099
if (i )
1098
1100
return i ;
1099
1101
cfdarg .charheight = op -> height ;
@@ -1183,7 +1185,7 @@ long vt_compat_ioctl(struct tty_struct *tty,
1183
1185
*/
1184
1186
case PIO_FONTX :
1185
1187
case GIO_FONTX :
1186
- return compat_fontx_ioctl (cmd , up , perm , & op );
1188
+ return compat_fontx_ioctl (vc , cmd , up , perm , & op );
1187
1189
1188
1190
case KDFONTOP :
1189
1191
return compat_kdfontop_ioctl (up , perm , & op , vc );
0 commit comments