aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-11-07 04:01:29 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:54:02 -0500
commit3c7208f253571ee5f157b98f0e315b5172afe092 (patch)
treee4c29817e4c097d8de9ef025b600d753d06a155e /drivers/isdn
parent735d5661d5c5f023a78fbe68e771e261040ff1b7 (diff)
[PATCH] kfree cleanup: drivers/isdn
This is the drivers/isdn/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in drivers/isdn/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c5
-rw-r--r--drivers/isdn/hisax/avm_pci.c12
-rw-r--r--drivers/isdn/hisax/avma1_cs.c4
-rw-r--r--drivers/isdn/hisax/config.c9
-rw-r--r--drivers/isdn/hisax/hfc_2bds0.c18
-rw-r--r--drivers/isdn/hisax/hfc_2bs0.c12
-rw-r--r--drivers/isdn/hisax/hscx.c12
-rw-r--r--drivers/isdn/hisax/icc.c12
-rw-r--r--drivers/isdn/hisax/ipacx.c12
-rw-r--r--drivers/isdn/hisax/isac.c15
-rw-r--r--drivers/isdn/hisax/isar.c6
-rw-r--r--drivers/isdn/hisax/jade.c12
-rw-r--r--drivers/isdn/hisax/netjet.c32
-rw-r--r--drivers/isdn/hisax/st5481_usb.c12
-rw-r--r--drivers/isdn/hisax/w6692.c12
-rw-r--r--drivers/isdn/hysdn/hysdn_procconf.c3
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c21
-rw-r--r--drivers/isdn/i4l/isdn_tty.c24
-rw-r--r--drivers/isdn/pcbit/drv.c6
19 files changed, 79 insertions, 160 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index db9bad2b3d16..27391c32f3eb 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -212,11 +212,8 @@ static void avmcs_detach(dev_link_t *link)
212 212
213 /* Unlink device structure, free pieces */ 213 /* Unlink device structure, free pieces */
214 *linkp = link->next; 214 *linkp = link->next;
215 if (link->priv) { 215 kfree(link->priv);
216 kfree(link->priv);
217 }
218 kfree(link); 216 kfree(link);
219
220} /* avmcs_detach */ 217} /* avmcs_detach */
221 218
222/*====================================================================== 219/*======================================================================
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index 625799ab0d14..5d8ee7368f7b 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -552,14 +552,10 @@ close_hdlcstate(struct BCState *bcs)
552{ 552{
553 modehdlc(bcs, 0, 0); 553 modehdlc(bcs, 0, 0);
554 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 554 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
555 if (bcs->hw.hdlc.rcvbuf) { 555 kfree(bcs->hw.hdlc.rcvbuf);
556 kfree(bcs->hw.hdlc.rcvbuf); 556 bcs->hw.hdlc.rcvbuf = NULL;
557 bcs->hw.hdlc.rcvbuf = NULL; 557 kfree(bcs->blog);
558 } 558 bcs->blog = NULL;
559 if (bcs->blog) {
560 kfree(bcs->blog);
561 bcs->blog = NULL;
562 }
563 skb_queue_purge(&bcs->rqueue); 559 skb_queue_purge(&bcs->rqueue);
564 skb_queue_purge(&bcs->squeue); 560 skb_queue_purge(&bcs->squeue);
565 if (bcs->tx_skb) { 561 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 0e22991635e7..5f5a5ae740d2 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -236,9 +236,7 @@ static void avma1cs_detach(dev_link_t *link)
236 236
237 /* Unlink device structure, free pieces */ 237 /* Unlink device structure, free pieces */
238 *linkp = link->next; 238 *linkp = link->next;
239 if (link->priv) { 239 kfree(link->priv);
240 kfree(link->priv);
241 }
242 kfree(link); 240 kfree(link);
243 241
244} /* avma1cs_detach */ 242} /* avma1cs_detach */
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index fbaab4352902..8159bcecd0c2 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -787,8 +787,7 @@ static void ll_unload(struct IsdnCardState *cs)
787 ic.command = ISDN_STAT_UNLOAD; 787 ic.command = ISDN_STAT_UNLOAD;
788 ic.driver = cs->myid; 788 ic.driver = cs->myid;
789 cs->iif.statcallb(&ic); 789 cs->iif.statcallb(&ic);
790 if (cs->status_buf) 790 kfree(cs->status_buf);
791 kfree(cs->status_buf);
792 cs->status_read = NULL; 791 cs->status_read = NULL;
793 cs->status_write = NULL; 792 cs->status_write = NULL;
794 cs->status_end = NULL; 793 cs->status_end = NULL;
@@ -807,10 +806,8 @@ static void closecard(int cardnr)
807 806
808 skb_queue_purge(&csta->rq); 807 skb_queue_purge(&csta->rq);
809 skb_queue_purge(&csta->sq); 808 skb_queue_purge(&csta->sq);
810 if (csta->rcvbuf) { 809 kfree(csta->rcvbuf);
811 kfree(csta->rcvbuf); 810 csta->rcvbuf = NULL;
812 csta->rcvbuf = NULL;
813 }
814 if (csta->tx_skb) { 811 if (csta->tx_skb) {
815 dev_kfree_skb(csta->tx_skb); 812 dev_kfree_skb(csta->tx_skb);
816 csta->tx_skb = NULL; 813 csta->tx_skb = NULL;
diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c
index 7cf87793e790..637a261c9312 100644
--- a/drivers/isdn/hisax/hfc_2bds0.c
+++ b/drivers/isdn/hisax/hfc_2bds0.c
@@ -1052,18 +1052,12 @@ init2bds0(struct IsdnCardState *cs)
1052void 1052void
1053release2bds0(struct IsdnCardState *cs) 1053release2bds0(struct IsdnCardState *cs)
1054{ 1054{
1055 if (cs->bcs[0].hw.hfc.send) { 1055 kfree(cs->bcs[0].hw.hfc.send);
1056 kfree(cs->bcs[0].hw.hfc.send); 1056 cs->bcs[0].hw.hfc.send = NULL;
1057 cs->bcs[0].hw.hfc.send = NULL; 1057 kfree(cs->bcs[1].hw.hfc.send);
1058 } 1058 cs->bcs[1].hw.hfc.send = NULL;
1059 if (cs->bcs[1].hw.hfc.send) { 1059 kfree(cs->hw.hfcD.send);
1060 kfree(cs->bcs[1].hw.hfc.send); 1060 cs->hw.hfcD.send = NULL;
1061 cs->bcs[1].hw.hfc.send = NULL;
1062 }
1063 if (cs->hw.hfcD.send) {
1064 kfree(cs->hw.hfcD.send);
1065 cs->hw.hfcD.send = NULL;
1066 }
1067} 1061}
1068 1062
1069void 1063void
diff --git a/drivers/isdn/hisax/hfc_2bs0.c b/drivers/isdn/hisax/hfc_2bs0.c
index f978a5af8662..c964539cc43e 100644
--- a/drivers/isdn/hisax/hfc_2bs0.c
+++ b/drivers/isdn/hisax/hfc_2bs0.c
@@ -582,12 +582,8 @@ inithfc(struct IsdnCardState *cs)
582void 582void
583releasehfc(struct IsdnCardState *cs) 583releasehfc(struct IsdnCardState *cs)
584{ 584{
585 if (cs->bcs[0].hw.hfc.send) { 585 kfree(cs->bcs[0].hw.hfc.send);
586 kfree(cs->bcs[0].hw.hfc.send); 586 cs->bcs[0].hw.hfc.send = NULL;
587 cs->bcs[0].hw.hfc.send = NULL; 587 kfree(cs->bcs[1].hw.hfc.send);
588 } 588 cs->bcs[1].hw.hfc.send = NULL;
589 if (cs->bcs[1].hw.hfc.send) {
590 kfree(cs->bcs[1].hw.hfc.send);
591 cs->bcs[1].hw.hfc.send = NULL;
592 }
593} 589}
diff --git a/drivers/isdn/hisax/hscx.c b/drivers/isdn/hisax/hscx.c
index 66dbaee77bfb..c8f9951f7914 100644
--- a/drivers/isdn/hisax/hscx.c
+++ b/drivers/isdn/hisax/hscx.c
@@ -156,14 +156,10 @@ close_hscxstate(struct BCState *bcs)
156{ 156{
157 modehscx(bcs, 0, bcs->channel); 157 modehscx(bcs, 0, bcs->channel);
158 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 158 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
159 if (bcs->hw.hscx.rcvbuf) { 159 kfree(bcs->hw.hscx.rcvbuf);
160 kfree(bcs->hw.hscx.rcvbuf); 160 bcs->hw.hscx.rcvbuf = NULL;
161 bcs->hw.hscx.rcvbuf = NULL; 161 kfree(bcs->blog);
162 } 162 bcs->blog = NULL;
163 if (bcs->blog) {
164 kfree(bcs->blog);
165 bcs->blog = NULL;
166 }
167 skb_queue_purge(&bcs->rqueue); 163 skb_queue_purge(&bcs->rqueue);
168 skb_queue_purge(&bcs->squeue); 164 skb_queue_purge(&bcs->squeue);
169 if (bcs->tx_skb) { 165 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c
index b4ca5859b177..c615752b96aa 100644
--- a/drivers/isdn/hisax/icc.c
+++ b/drivers/isdn/hisax/icc.c
@@ -571,14 +571,10 @@ setstack_icc(struct PStack *st, struct IsdnCardState *cs)
571 571
572static void 572static void
573DC_Close_icc(struct IsdnCardState *cs) { 573DC_Close_icc(struct IsdnCardState *cs) {
574 if (cs->dc.icc.mon_rx) { 574 kfree(cs->dc.icc.mon_rx);
575 kfree(cs->dc.icc.mon_rx); 575 cs->dc.icc.mon_rx = NULL;
576 cs->dc.icc.mon_rx = NULL; 576 kfree(cs->dc.icc.mon_tx);
577 } 577 cs->dc.icc.mon_tx = NULL;
578 if (cs->dc.icc.mon_tx) {
579 kfree(cs->dc.icc.mon_tx);
580 cs->dc.icc.mon_tx = NULL;
581 }
582} 578}
583 579
584static void 580static void
diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c
index efba2f448017..2e9afae1254a 100644
--- a/drivers/isdn/hisax/ipacx.c
+++ b/drivers/isdn/hisax/ipacx.c
@@ -762,14 +762,10 @@ bch_close_state(struct BCState *bcs)
762{ 762{
763 bch_mode(bcs, 0, bcs->channel); 763 bch_mode(bcs, 0, bcs->channel);
764 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 764 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
765 if (bcs->hw.hscx.rcvbuf) { 765 kfree(bcs->hw.hscx.rcvbuf);
766 kfree(bcs->hw.hscx.rcvbuf); 766 bcs->hw.hscx.rcvbuf = NULL;
767 bcs->hw.hscx.rcvbuf = NULL; 767 kfree(bcs->blog);
768 } 768 bcs->blog = NULL;
769 if (bcs->blog) {
770 kfree(bcs->blog);
771 bcs->blog = NULL;
772 }
773 skb_queue_purge(&bcs->rqueue); 769 skb_queue_purge(&bcs->rqueue);
774 skb_queue_purge(&bcs->squeue); 770 skb_queue_purge(&bcs->squeue);
775 if (bcs->tx_skb) { 771 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c
index 85e063a08d23..565b7892c267 100644
--- a/drivers/isdn/hisax/isac.c
+++ b/drivers/isdn/hisax/isac.c
@@ -570,15 +570,12 @@ setstack_isac(struct PStack *st, struct IsdnCardState *cs)
570} 570}
571 571
572static void 572static void
573DC_Close_isac(struct IsdnCardState *cs) { 573DC_Close_isac(struct IsdnCardState *cs)
574 if (cs->dc.isac.mon_rx) { 574{
575 kfree(cs->dc.isac.mon_rx); 575 kfree(cs->dc.isac.mon_rx);
576 cs->dc.isac.mon_rx = NULL; 576 cs->dc.isac.mon_rx = NULL;
577 } 577 kfree(cs->dc.isac.mon_tx);
578 if (cs->dc.isac.mon_tx) { 578 cs->dc.isac.mon_tx = NULL;
579 kfree(cs->dc.isac.mon_tx);
580 cs->dc.isac.mon_tx = NULL;
581 }
582} 579}
583 580
584static void 581static void
diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c
index 642a87c51295..674af673ff96 100644
--- a/drivers/isdn/hisax/isar.c
+++ b/drivers/isdn/hisax/isar.c
@@ -1688,10 +1688,8 @@ close_isarstate(struct BCState *bcs)
1688{ 1688{
1689 modeisar(bcs, 0, bcs->channel); 1689 modeisar(bcs, 0, bcs->channel);
1690 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 1690 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
1691 if (bcs->hw.isar.rcvbuf) { 1691 kfree(bcs->hw.isar.rcvbuf);
1692 kfree(bcs->hw.isar.rcvbuf); 1692 bcs->hw.isar.rcvbuf = NULL;
1693 bcs->hw.isar.rcvbuf = NULL;
1694 }
1695 skb_queue_purge(&bcs->rqueue); 1693 skb_queue_purge(&bcs->rqueue);
1696 skb_queue_purge(&bcs->squeue); 1694 skb_queue_purge(&bcs->squeue);
1697 if (bcs->tx_skb) { 1695 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/jade.c b/drivers/isdn/hisax/jade.c
index 363ae3179bbd..2659fecc2674 100644
--- a/drivers/isdn/hisax/jade.c
+++ b/drivers/isdn/hisax/jade.c
@@ -195,14 +195,10 @@ close_jadestate(struct BCState *bcs)
195{ 195{
196 modejade(bcs, 0, bcs->channel); 196 modejade(bcs, 0, bcs->channel);
197 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 197 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
198 if (bcs->hw.hscx.rcvbuf) { 198 kfree(bcs->hw.hscx.rcvbuf);
199 kfree(bcs->hw.hscx.rcvbuf); 199 bcs->hw.hscx.rcvbuf = NULL;
200 bcs->hw.hscx.rcvbuf = NULL; 200 kfree(bcs->blog);
201 } 201 bcs->blog = NULL;
202 if (bcs->blog) {
203 kfree(bcs->blog);
204 bcs->blog = NULL;
205 }
206 skb_queue_purge(&bcs->rqueue); 202 skb_queue_purge(&bcs->rqueue);
207 skb_queue_purge(&bcs->squeue); 203 skb_queue_purge(&bcs->squeue);
208 if (bcs->tx_skb) { 204 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c
index 94da03c30c51..47a47ef0968b 100644
--- a/drivers/isdn/hisax/netjet.c
+++ b/drivers/isdn/hisax/netjet.c
@@ -855,14 +855,10 @@ close_tigerstate(struct BCState *bcs)
855{ 855{
856 mode_tiger(bcs, 0, bcs->channel); 856 mode_tiger(bcs, 0, bcs->channel);
857 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 857 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
858 if (bcs->hw.tiger.rcvbuf) { 858 kfree(bcs->hw.tiger.rcvbuf);
859 kfree(bcs->hw.tiger.rcvbuf); 859 bcs->hw.tiger.rcvbuf = NULL;
860 bcs->hw.tiger.rcvbuf = NULL; 860 kfree(bcs->hw.tiger.sendbuf);
861 } 861 bcs->hw.tiger.sendbuf = NULL;
862 if (bcs->hw.tiger.sendbuf) {
863 kfree(bcs->hw.tiger.sendbuf);
864 bcs->hw.tiger.sendbuf = NULL;
865 }
866 skb_queue_purge(&bcs->rqueue); 862 skb_queue_purge(&bcs->rqueue);
867 skb_queue_purge(&bcs->squeue); 863 skb_queue_purge(&bcs->squeue);
868 if (bcs->tx_skb) { 864 if (bcs->tx_skb) {
@@ -967,20 +963,12 @@ inittiger(struct IsdnCardState *cs)
967static void 963static void
968releasetiger(struct IsdnCardState *cs) 964releasetiger(struct IsdnCardState *cs)
969{ 965{
970 if (cs->bcs[0].hw.tiger.send) { 966 kfree(cs->bcs[0].hw.tiger.send);
971 kfree(cs->bcs[0].hw.tiger.send); 967 cs->bcs[0].hw.tiger.send = NULL;
972 cs->bcs[0].hw.tiger.send = NULL; 968 cs->bcs[1].hw.tiger.send = NULL;
973 } 969 kfree(cs->bcs[0].hw.tiger.rec);
974 if (cs->bcs[1].hw.tiger.send) { 970 cs->bcs[0].hw.tiger.rec = NULL;
975 cs->bcs[1].hw.tiger.send = NULL; 971 cs->bcs[1].hw.tiger.rec = NULL;
976 }
977 if (cs->bcs[0].hw.tiger.rec) {
978 kfree(cs->bcs[0].hw.tiger.rec);
979 cs->bcs[0].hw.tiger.rec = NULL;
980 }
981 if (cs->bcs[1].hw.tiger.rec) {
982 cs->bcs[1].hw.tiger.rec = NULL;
983 }
984} 972}
985 973
986void 974void
diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c
index 89fbeb58485d..b096b64b0253 100644
--- a/drivers/isdn/hisax/st5481_usb.c
+++ b/drivers/isdn/hisax/st5481_usb.c
@@ -335,14 +335,12 @@ void st5481_release_usb(struct st5481_adapter *adapter)
335 335
336 // Stop and free Control and Interrupt URBs 336 // Stop and free Control and Interrupt URBs
337 usb_kill_urb(ctrl->urb); 337 usb_kill_urb(ctrl->urb);
338 if (ctrl->urb->transfer_buffer) 338 kfree(ctrl->urb->transfer_buffer);
339 kfree(ctrl->urb->transfer_buffer);
340 usb_free_urb(ctrl->urb); 339 usb_free_urb(ctrl->urb);
341 ctrl->urb = NULL; 340 ctrl->urb = NULL;
342 341
343 usb_kill_urb(intr->urb); 342 usb_kill_urb(intr->urb);
344 if (intr->urb->transfer_buffer) 343 kfree(intr->urb->transfer_buffer);
345 kfree(intr->urb->transfer_buffer);
346 usb_free_urb(intr->urb); 344 usb_free_urb(intr->urb);
347 ctrl->urb = NULL; 345 ctrl->urb = NULL;
348} 346}
@@ -457,8 +455,7 @@ st5481_setup_isocpipes(struct urb* urb[2], struct usb_device *dev,
457 err: 455 err:
458 for (j = 0; j < 2; j++) { 456 for (j = 0; j < 2; j++) {
459 if (urb[j]) { 457 if (urb[j]) {
460 if (urb[j]->transfer_buffer) 458 kfree(urb[j]->transfer_buffer);
461 kfree(urb[j]->transfer_buffer);
462 urb[j]->transfer_buffer = NULL; 459 urb[j]->transfer_buffer = NULL;
463 usb_free_urb(urb[j]); 460 usb_free_urb(urb[j]);
464 urb[j] = NULL; 461 urb[j] = NULL;
@@ -473,8 +470,7 @@ void st5481_release_isocpipes(struct urb* urb[2])
473 470
474 for (j = 0; j < 2; j++) { 471 for (j = 0; j < 2; j++) {
475 usb_kill_urb(urb[j]); 472 usb_kill_urb(urb[j]);
476 if (urb[j]->transfer_buffer) 473 kfree(urb[j]->transfer_buffer);
477 kfree(urb[j]->transfer_buffer);
478 usb_free_urb(urb[j]); 474 usb_free_urb(urb[j]);
479 urb[j] = NULL; 475 urb[j] = NULL;
480 } 476 }
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
index 7baf8e488471..0352ee5f706c 100644
--- a/drivers/isdn/hisax/w6692.c
+++ b/drivers/isdn/hisax/w6692.c
@@ -819,14 +819,10 @@ close_w6692state(struct BCState *bcs)
819{ 819{
820 W6692Bmode(bcs, 0, bcs->channel); 820 W6692Bmode(bcs, 0, bcs->channel);
821 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { 821 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
822 if (bcs->hw.w6692.rcvbuf) { 822 kfree(bcs->hw.w6692.rcvbuf);
823 kfree(bcs->hw.w6692.rcvbuf); 823 bcs->hw.w6692.rcvbuf = NULL;
824 bcs->hw.w6692.rcvbuf = NULL; 824 kfree(bcs->blog);
825 } 825 bcs->blog = NULL;
826 if (bcs->blog) {
827 kfree(bcs->blog);
828 bcs->blog = NULL;
829 }
830 skb_queue_purge(&bcs->rqueue); 826 skb_queue_purge(&bcs->rqueue);
831 skb_queue_purge(&bcs->squeue); 827 skb_queue_purge(&bcs->squeue);
832 if (bcs->tx_skb) { 828 if (bcs->tx_skb) {
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c
index 639582f61f41..87f59a0e2a95 100644
--- a/drivers/isdn/hysdn/hysdn_procconf.c
+++ b/drivers/isdn/hysdn/hysdn_procconf.c
@@ -359,8 +359,7 @@ hysdn_conf_close(struct inode *ino, struct file *filep)
359 } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) { 359 } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) {
360 /* read access -> output card info data */ 360 /* read access -> output card info data */
361 361
362 if (filep->private_data) 362 kfree(filep->private_data); /* release memory */
363 kfree(filep->private_data); /* release memory */
364 } 363 }
365 unlock_kernel(); 364 unlock_kernel();
366 return (retval); 365 return (retval);
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index d97a9be5469c..1a19a0f89428 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -364,10 +364,8 @@ isdn_ppp_release(int min, struct file *file)
364 isdn_net_hangup(&p->dev); 364 isdn_net_hangup(&p->dev);
365 } 365 }
366 for (i = 0; i < NUM_RCV_BUFFS; i++) { 366 for (i = 0; i < NUM_RCV_BUFFS; i++) {
367 if (is->rq[i].buf) { 367 kfree(is->rq[i].buf);
368 kfree(is->rq[i].buf); 368 is->rq[i].buf = NULL;
369 is->rq[i].buf = NULL;
370 }
371 } 369 }
372 is->first = is->rq + NUM_RCV_BUFFS - 1; /* receive queue */ 370 is->first = is->rq + NUM_RCV_BUFFS - 1; /* receive queue */
373 is->last = is->rq; 371 is->last = is->rq;
@@ -378,14 +376,10 @@ isdn_ppp_release(int min, struct file *file)
378 is->slcomp = NULL; 376 is->slcomp = NULL;
379#endif 377#endif
380#ifdef CONFIG_IPPP_FILTER 378#ifdef CONFIG_IPPP_FILTER
381 if (is->pass_filter) { 379 kfree(is->pass_filter);
382 kfree(is->pass_filter); 380 is->pass_filter = NULL;
383 is->pass_filter = NULL; 381 kfree(is->active_filter);
384 } 382 is->active_filter = NULL;
385 if (is->active_filter) {
386 kfree(is->active_filter);
387 is->active_filter = NULL;
388 }
389#endif 383#endif
390 384
391/* TODO: if this was the previous master: link the stuff to the new master */ 385/* TODO: if this was the previous master: link the stuff to the new master */
@@ -914,8 +908,7 @@ isdn_ppp_cleanup(void)
914 kfree(ippp_table[i]); 908 kfree(ippp_table[i]);
915 909
916#ifdef CONFIG_ISDN_MPP 910#ifdef CONFIG_ISDN_MPP
917 if (isdn_ppp_bundle_arr) 911 kfree(isdn_ppp_bundle_arr);
918 kfree(isdn_ppp_bundle_arr);
919#endif /* CONFIG_ISDN_MPP */ 912#endif /* CONFIG_ISDN_MPP */
920 913
921} 914}
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 356ee485be4b..8c404b4e2482 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -712,22 +712,14 @@ isdn_tty_modem_hup(modem_info * info, int local)
712#endif 712#endif
713 info->emu.vpar[4] = 0; 713 info->emu.vpar[4] = 0;
714 info->emu.vpar[5] = 8; 714 info->emu.vpar[5] = 8;
715 if (info->dtmf_state) { 715 kfree(info->dtmf_state);
716 kfree(info->dtmf_state); 716 info->dtmf_state = NULL;
717 info->dtmf_state = NULL; 717 kfree(info->silence_state);
718 } 718 info->silence_state = NULL;
719 if (info->silence_state) { 719 kfree(info->adpcms);
720 kfree(info->silence_state); 720 info->adpcms = NULL;
721 info->silence_state = NULL; 721 kfree(info->adpcmr);
722 } 722 info->adpcmr = NULL;
723 if (info->adpcms) {
724 kfree(info->adpcms);
725 info->adpcms = NULL;
726 }
727 if (info->adpcmr) {
728 kfree(info->adpcmr);
729 info->adpcmr = NULL;
730 }
731#endif 723#endif
732 if ((info->msr & UART_MSR_RI) && 724 if ((info->msr & UART_MSR_RI) &&
733 (info->emu.mdmreg[REG_RUNG] & BIT_RUNG)) 725 (info->emu.mdmreg[REG_RUNG] & BIT_RUNG))
diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c
index 5de861f40816..94f21486bb24 100644
--- a/drivers/isdn/pcbit/drv.c
+++ b/drivers/isdn/pcbit/drv.c
@@ -561,10 +561,8 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
561 else 561 else
562 pcbit_fsm_event(dev, chan, EV_USR_RELEASE_REQ, NULL); 562 pcbit_fsm_event(dev, chan, EV_USR_RELEASE_REQ, NULL);
563 563
564 if (cbdata.data.setup.CalledPN) 564 kfree(cbdata.data.setup.CalledPN);
565 kfree(cbdata.data.setup.CalledPN); 565 kfree(cbdata.data.setup.CallingPN);
566 if (cbdata.data.setup.CallingPN)
567 kfree(cbdata.data.setup.CallingPN);
568 break; 566 break;
569 567
570 case MSG_CONN_CONF: 568 case MSG_CONN_CONF: