aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/isdn/gigaset/common.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 68db361e766e..749b3da1236e 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -1110,8 +1110,9 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
1110 drv = kmalloc(sizeof *drv, GFP_KERNEL); 1110 drv = kmalloc(sizeof *drv, GFP_KERNEL);
1111 if (!drv) 1111 if (!drv)
1112 return NULL; 1112 return NULL;
1113
1113 if (!try_module_get(owner)) 1114 if (!try_module_get(owner))
1114 return NULL; 1115 goto out1;
1115 1116
1116 drv->cs = NULL; 1117 drv->cs = NULL;
1117 drv->have_tty = 0; 1118 drv->have_tty = 0;
@@ -1125,10 +1126,11 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
1125 1126
1126 drv->cs = kmalloc(minors * sizeof *drv->cs, GFP_KERNEL); 1127 drv->cs = kmalloc(minors * sizeof *drv->cs, GFP_KERNEL);
1127 if (!drv->cs) 1128 if (!drv->cs)
1128 goto out1; 1129 goto out2;
1130
1129 drv->flags = kmalloc(minors * sizeof *drv->flags, GFP_KERNEL); 1131 drv->flags = kmalloc(minors * sizeof *drv->flags, GFP_KERNEL);
1130 if (!drv->flags) 1132 if (!drv->flags)
1131 goto out2; 1133 goto out3;
1132 1134
1133 for (i = 0; i < minors; ++i) { 1135 for (i = 0; i < minors; ++i) {
1134 drv->flags[i] = 0; 1136 drv->flags[i] = 0;
@@ -1145,11 +1147,12 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
1145 1147
1146 return drv; 1148 return drv;
1147 1149
1148out2: 1150out3:
1149 kfree(drv->cs); 1151 kfree(drv->cs);
1152out2:
1153 module_put(owner);
1150out1: 1154out1:
1151 kfree(drv); 1155 kfree(drv);
1152 module_put(owner);
1153 return NULL; 1156 return NULL;
1154} 1157}
1155EXPORT_SYMBOL_GPL(gigaset_initdriver); 1158EXPORT_SYMBOL_GPL(gigaset_initdriver);