Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c7208f2 authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds
Browse files

[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: default avatarJesper Juhl <jesper.juhl@gmail.com>
Acked-by: default avatarKarsten Keil <kkeil@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 735d5661
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -212,11 +212,8 @@ static void avmcs_detach(dev_link_t *link)
    
    /* Unlink device structure, free pieces */
    *linkp = link->next;
    if (link->priv) {
    kfree(link->priv);
    }
    kfree(link);
    
} /* avmcs_detach */

/*======================================================================
+4 −8
Original line number Diff line number Diff line
@@ -552,14 +552,10 @@ close_hdlcstate(struct BCState *bcs)
{
	modehdlc(bcs, 0, 0);
	if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
		if (bcs->hw.hdlc.rcvbuf) {
		kfree(bcs->hw.hdlc.rcvbuf);
		bcs->hw.hdlc.rcvbuf = NULL;
		}
		if (bcs->blog) {
		kfree(bcs->blog);
		bcs->blog = NULL;
		}
		skb_queue_purge(&bcs->rqueue);
		skb_queue_purge(&bcs->squeue);
		if (bcs->tx_skb) {
+1 −3
Original line number Diff line number Diff line
@@ -236,9 +236,7 @@ static void avma1cs_detach(dev_link_t *link)
    
    /* Unlink device structure, free pieces */
    *linkp = link->next;
    if (link->priv) {
    kfree(link->priv);
    }
    kfree(link);
    
} /* avma1cs_detach */
+3 −6
Original line number Diff line number Diff line
@@ -787,7 +787,6 @@ static void ll_unload(struct IsdnCardState *cs)
	ic.command = ISDN_STAT_UNLOAD;
	ic.driver = cs->myid;
	cs->iif.statcallb(&ic);
	if (cs->status_buf)
	kfree(cs->status_buf);
	cs->status_read = NULL;
	cs->status_write = NULL;
@@ -807,10 +806,8 @@ static void closecard(int cardnr)

	skb_queue_purge(&csta->rq);
	skb_queue_purge(&csta->sq);
	if (csta->rcvbuf) {
	kfree(csta->rcvbuf);
	csta->rcvbuf = NULL;
	}
	if (csta->tx_skb) {
		dev_kfree_skb(csta->tx_skb);
		csta->tx_skb = NULL;
+6 −12
Original line number Diff line number Diff line
@@ -1052,19 +1052,13 @@ init2bds0(struct IsdnCardState *cs)
void
release2bds0(struct IsdnCardState *cs)
{
	if (cs->bcs[0].hw.hfc.send) {
	kfree(cs->bcs[0].hw.hfc.send);
	cs->bcs[0].hw.hfc.send = NULL;
	}
	if (cs->bcs[1].hw.hfc.send) {
	kfree(cs->bcs[1].hw.hfc.send);
	cs->bcs[1].hw.hfc.send = NULL;
	}
	if (cs->hw.hfcD.send) {
	kfree(cs->hw.hfcD.send);
	cs->hw.hfcD.send = NULL;
}
}

void
set_cs_func(struct IsdnCardState *cs)
Loading