diff mbox

isdn: eicon: free pointer after using it in log msg in divas_um_idi_delete_entity()

Message ID alpine.LNX.2.00.1309302119550.4992@swampdragon.chaosbits.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jesper Juhl Sept. 30, 2013, 7:25 p.m. UTC
Not really a problem, but nice IMHO; the Coverity static analyzer
complains that we use the pointer 'e' after it has been freed, so move
the freeing below the final use, even if that use is just using the
value of the pointer and not actually dereferencing it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 drivers/isdn/hardware/eicon/um_idi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

--
1.7.1

Comments

David Miller Oct. 2, 2013, 8:01 p.m. UTC | #1
From: Jesper Juhl <jj@chaosbits.net>
Date: Mon, 30 Sep 2013 21:25:27 +0200 (CEST)

> Not really a problem, but nice IMHO; the Coverity static analyzer
> complains that we use the pointer 'e' after it has been freed, so move
> the freeing below the final use, even if that use is just using the
> value of the pointer and not actually dereferencing it.
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/isdn/hardware/eicon/um_idi.c b/drivers/isdn/hardware/eicon/um_idi.c
index 7cab5c3..e151971 100644
--- a/drivers/isdn/hardware/eicon/um_idi.c
+++ b/drivers/isdn/hardware/eicon/um_idi.c
@@ -288,9 +288,9 @@  int divas_um_idi_delete_entity(int adapter_nr, void *entity)
 	cleanup_entity(e);
 	diva_os_free(0, e->os_context);
 	memset(e, 0x00, sizeof(*e));
-	diva_os_free(0, e);

 	DBG_LOG(("A(%d) remove E:%08x", adapter_nr, e));
+	diva_os_free(0, e);

 	return (0);
 }