netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] dm9000: NULL dereferences on error in probe()
@ 2014-08-01  8:23 Dan Carpenter
  2014-08-02 22:28 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-08-01  8:23 UTC (permalink / raw)
  To: Grant Likely
  Cc: Rob Herring, David S. Miller, Andrew Ruder, Nikita Kiryanov,
	Igor Grinberg, Paul Gortmaker, Jingoo Han, Eric W. Biederman,
	Michael Abbott, Barry Song, netdev, kernel-janitors

The dm9000_release_board() function is called with NULL ->data_req and
->addr_req pointers if dm9000_probe() fails.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Old bug, but not serious.

diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 13723c9..23084fb 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -817,10 +817,12 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db)
 
 	/* release the resources */
 
-	release_resource(db->data_req);
+	if (db->data_req)
+		release_resource(db->data_req);
 	kfree(db->data_req);
 
-	release_resource(db->addr_req);
+	if (db->addr_req)
+		release_resource(db->addr_req);
 	kfree(db->addr_req);
 }
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] dm9000: NULL dereferences on error in probe()
  2014-08-01  8:23 [patch] dm9000: NULL dereferences on error in probe() Dan Carpenter
@ 2014-08-02 22:28 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-08-02 22:28 UTC (permalink / raw)
  To: dan.carpenter
  Cc: grant.likely, robh+dt, andrew.ruder, nikita, grinberg,
	paul.gortmaker, jg1.han, ebiederm, michael.abbott, Baohua.Song,
	netdev, kernel-janitors

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 1 Aug 2014 11:23:57 +0300

> The dm9000_release_board() function is called with NULL ->data_req and
> ->addr_req pointers if dm9000_probe() fails.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied to net-next, thanks Dan.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-02 22:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-01  8:23 [patch] dm9000: NULL dereferences on error in probe() Dan Carpenter
2014-08-02 22:28 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).