mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 01:21:01 +07:00
snsc: check return value of class_create
return value of class_create should be considered in module init function. Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
26ec99b105
commit
c1e8ad2311
@ -385,13 +385,18 @@ scdrv_init(void)
|
||||
|
||||
event_nasid = ia64_sn_get_console_nasid();
|
||||
|
||||
snsc_class = class_create(THIS_MODULE, SYSCTL_BASENAME);
|
||||
if (IS_ERR(snsc_class)) {
|
||||
printk("%s: failed to allocate class\n", __func__);
|
||||
return PTR_ERR(snsc_class);
|
||||
}
|
||||
|
||||
if (alloc_chrdev_region(&first_dev, 0, num_cnodes,
|
||||
SYSCTL_BASENAME) < 0) {
|
||||
printk("%s: failed to register SN system controller device\n",
|
||||
__func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
snsc_class = class_create(THIS_MODULE, SYSCTL_BASENAME);
|
||||
|
||||
for (cnode = 0; cnode < num_cnodes; cnode++) {
|
||||
geoid = cnodeid_get_geoid(cnode);
|
||||
|
Loading…
Reference in New Issue
Block a user