Null-check ihk_os_t and mcctrl_usrdata pointers
Change-Id: I941c58d4ab6a0c1ce6bd53c24b552218a1716750 Refs: #1216
This commit is contained in:
committed by
Dominique Martinet
parent
bdf5175d4c
commit
366e95856c
@@ -99,6 +99,11 @@ void setup_local_snooping_files(ihk_os_t os)
|
||||
int i;
|
||||
int error;
|
||||
|
||||
if (!udp) {
|
||||
panic("%s: error: mcctrl_usrdata not found\n",
|
||||
__func__);
|
||||
}
|
||||
|
||||
memset(udp->cpu_online, 0, sizeof(udp->cpu_online));
|
||||
for (i = 0; i < udp->cpu_info->n_cpus; i++) {
|
||||
set_bit(i, udp->cpu_online);
|
||||
@@ -195,7 +200,7 @@ void free_topology_info(ihk_os_t os)
|
||||
struct mcctrl_usrdata *udp = ihk_host_os_get_usrdata(os);
|
||||
|
||||
if (!udp) {
|
||||
printk("%s: WARNING: no mcctrl_usrdata found\n", __FUNCTION__);
|
||||
pr_warn("%s: warning: mcctrl_usrdata not found\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1136,6 +1141,11 @@ void setup_sysfs_files(ihk_os_t os)
|
||||
struct sysfs_handle handle;
|
||||
struct mcctrl_usrdata *udp = ihk_host_os_get_usrdata(os);
|
||||
|
||||
if (!udp) {
|
||||
panic("%s: error: mcctrl_usrdata not found\n",
|
||||
__func__);
|
||||
}
|
||||
|
||||
error = sysfsm_mkdirf(os, NULL, "/sys/test/x.dir");
|
||||
if (error) {
|
||||
panic("sysfsm_mkdir(x.dir)");
|
||||
|
||||
Reference in New Issue
Block a user