File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ static void iucv_setmask_mp(void)
519
519
*/
520
520
static void iucv_setmask_up (void )
521
521
{
522
- cpumask_t cpumask ;
522
+ static cpumask_t cpumask ;
523
523
int cpu ;
524
524
525
525
/* Disable all cpu but the first in cpu_irq_cpumask. */
@@ -627,23 +627,33 @@ static int iucv_cpu_online(unsigned int cpu)
627
627
628
628
static int iucv_cpu_down_prep (unsigned int cpu )
629
629
{
630
- cpumask_t cpumask ;
630
+ cpumask_var_t cpumask ;
631
+ int ret = 0 ;
631
632
632
633
if (!iucv_path_table )
633
634
return 0 ;
634
635
635
- cpumask_copy (& cpumask , & iucv_buffer_cpumask );
636
- cpumask_clear_cpu (cpu , & cpumask );
637
- if (cpumask_empty (& cpumask ))
636
+ if (!alloc_cpumask_var (& cpumask , GFP_KERNEL ))
637
+ return - ENOMEM ;
638
+
639
+ cpumask_copy (cpumask , & iucv_buffer_cpumask );
640
+ cpumask_clear_cpu (cpu , cpumask );
641
+ if (cpumask_empty (cpumask )) {
638
642
/* Can't offline last IUCV enabled cpu. */
639
- return - EINVAL ;
643
+ ret = - EINVAL ;
644
+ goto __free_cpumask ;
645
+ }
640
646
641
647
iucv_retrieve_cpu (NULL );
642
648
if (!cpumask_empty (& iucv_irq_cpumask ))
643
- return 0 ;
649
+ goto __free_cpumask ;
650
+
644
651
smp_call_function_single (cpumask_first (& iucv_buffer_cpumask ),
645
652
iucv_allow_cpu , NULL , 1 );
646
- return 0 ;
653
+
654
+ __free_cpumask :
655
+ free_cpumask_var (cpumask );
656
+ return ret ;
647
657
}
648
658
649
659
/**
You can’t perform that action at this time.
0 commit comments