diff options
author | yizhouzhou@ict.ac.cn <yizhouzhou@ict.ac.cn> | 2016-09-23 16:06:00 +0200 |
---|---|---|
committer | Jesper Nilsson <jespern@axis.com> | 2016-09-23 16:06:00 +0200 |
commit | 2dc024e94578c53e2c579a48725c8fe2527f9d5e (patch) | |
tree | 488d908f2907270d7de9b5c2619d461fb32f4427 /arch/cris/arch-v32 | |
parent | 11c2ecdcf71bd801fda79bd99607388241d8d2ce (diff) | |
download | blackbird-op-linux-2dc024e94578c53e2c579a48725c8fe2527f9d5e.tar.gz blackbird-op-linux-2dc024e94578c53e2c579a48725c8fe2527f9d5e.zip |
cris: return of class_create should be considered
Return value of class_create should be considered in module init function.
Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
Signed-off-by: Jesper Nilsson <jespern@axis.com>
Diffstat (limited to 'arch/cris/arch-v32')
-rw-r--r-- | arch/cris/arch-v32/drivers/sync_serial.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index e989cee77414..ef515af1a377 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c @@ -1627,6 +1627,12 @@ static int __init etrax_sync_serial_init(void) /* Create a sysfs class for syncser */ syncser_class = class_create(THIS_MODULE, "syncser_class"); + if (IS_ERR(syncser_class)) { + pr_err("Failed to create a sysfs class for syncser\n"); + unregister_chrdev_region(syncser_first, minor_count); + cdev_del(syncser_cdev); + return -1; + } /* Initialize Ports */ #if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0) |