[PATCH] s390: kmalloc failure ignored in smp_get_save_area()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prevent NULL dereference if kmalloc() fails.

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
Found with sed: http://kernelnewbies.org/roelkluin

diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index be2cae0..dfeac28 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -247,6 +247,8 @@ static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu)
 		return;
 	}
 	zfcpdump_save_areas[cpu] = kmalloc(sizeof(union save_area), GFP_KERNEL);
+	if (zfcpdump_save_areas[cpu] == NULL)
+		return;
 	__cpu_logical_map[CPU_INIT_NO] = (__u16) phy_cpu;
 	while (signal_processor(CPU_INIT_NO, sigp_stop_and_store_status) ==
 	       sigp_busy)
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux