aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/isdn/gigaset/common.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index bc9d89a8c4f6..6849a11a1b24 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -507,6 +507,7 @@ void gigaset_freecs(struct cardstate *cs)
507 gig_dbg(DEBUG_INIT, "clearing at_state"); 507 gig_dbg(DEBUG_INIT, "clearing at_state");
508 clear_at_state(&cs->at_state); 508 clear_at_state(&cs->at_state);
509 dealloc_temp_at_states(cs); 509 dealloc_temp_at_states(cs);
510 tty_port_destroy(&cs->port);
510 511
511 /* fall through */ 512 /* fall through */
512 case 0: /* error in basic setup */ 513 case 0: /* error in basic setup */
@@ -518,7 +519,6 @@ f_bcs: gig_dbg(DEBUG_INIT, "freeing bcs[]");
518 kfree(cs->bcs); 519 kfree(cs->bcs);
519f_cs: gig_dbg(DEBUG_INIT, "freeing cs"); 520f_cs: gig_dbg(DEBUG_INIT, "freeing cs");
520 mutex_unlock(&cs->mutex); 521 mutex_unlock(&cs->mutex);
521 tty_port_destroy(&cs->port);
522 free_cs(cs); 522 free_cs(cs);
523} 523}
524EXPORT_SYMBOL_GPL(gigaset_freecs); 524EXPORT_SYMBOL_GPL(gigaset_freecs);
@@ -752,14 +752,14 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
752 gig_dbg(DEBUG_INIT, "setting up iif"); 752 gig_dbg(DEBUG_INIT, "setting up iif");
753 if (gigaset_isdn_regdev(cs, modulename) < 0) { 753 if (gigaset_isdn_regdev(cs, modulename) < 0) {
754 pr_err("error registering ISDN device\n"); 754 pr_err("error registering ISDN device\n");
755 goto error_port; 755 goto error;
756 } 756 }
757 757
758 make_valid(cs, VALID_ID); 758 make_valid(cs, VALID_ID);
759 ++cs->cs_init; 759 ++cs->cs_init;
760 gig_dbg(DEBUG_INIT, "setting up hw"); 760 gig_dbg(DEBUG_INIT, "setting up hw");
761 if (cs->ops->initcshw(cs) < 0) 761 if (cs->ops->initcshw(cs) < 0)
762 goto error_port; 762 goto error;
763 763
764 ++cs->cs_init; 764 ++cs->cs_init;
765 765
@@ -774,7 +774,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
774 gig_dbg(DEBUG_INIT, "setting up bcs[%d]", i); 774 gig_dbg(DEBUG_INIT, "setting up bcs[%d]", i);
775 if (gigaset_initbcs(cs->bcs + i, cs, i) < 0) { 775 if (gigaset_initbcs(cs->bcs + i, cs, i) < 0) {
776 pr_err("could not allocate channel %d data\n", i); 776 pr_err("could not allocate channel %d data\n", i);
777 goto error_port; 777 goto error;
778 } 778 }
779 } 779 }
780 780
@@ -787,8 +787,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
787 787
788 gig_dbg(DEBUG_INIT, "cs initialized"); 788 gig_dbg(DEBUG_INIT, "cs initialized");
789 return cs; 789 return cs;
790error_port: 790
791 tty_port_destroy(&cs->port);
792error: 791error:
793 gig_dbg(DEBUG_INIT, "failed"); 792 gig_dbg(DEBUG_INIT, "failed");
794 gigaset_freecs(cs); 793 gigaset_freecs(cs);