netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch -next] mv643xx_eth: potential null dereference
@ 2010-07-23 10:15 Dan Carpenter
  2010-07-23 10:32 ` Joe Perches
  0 siblings, 1 reply; 11+ messages in thread
From: Dan Carpenter @ 2010-07-23 10:15 UTC (permalink / raw)
  To: Lennert Buytenhek
  Cc: David S. Miller, Jiri Pirko, Denis Kirjanov, Saeed Bishara,
	netdev, kernel-janitors

We assume that "pd" can be null on the previous line, and throughout the
function so we should check it here as well.  This was introduced by
9b2c2ff7a1c0 "mv643xx_eth: use sw csum for big packets"

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 2fcdb1e..9166f55 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -2675,7 +2675,8 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 	 * Detect hardware parameters.
 	 */
 	msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk : 133000000;
-	msp->tx_csum_limit = pd->tx_csum_limit ? pd->tx_csum_limit : 9 * 1024;
+	msp->tx_csum_limit = (pd && pd->tx_csum_limit) ?
+					pd->tx_csum_limit : 9 * 1024;
 	infer_hw_params(msp);
 
 	platform_set_drvdata(pdev, msp);

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

end of thread, other threads:[~2010-07-25 15:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-23 10:15 [patch -next] mv643xx_eth: potential null dereference Dan Carpenter
2010-07-23 10:32 ` Joe Perches
2010-07-23 11:05   ` [patch -next v2] " Dan Carpenter
2010-07-23 11:18     ` Lennert Buytenhek
2010-07-23 20:05       ` David Miller
2010-07-23 16:30     ` walter harms
2010-07-23 22:15       ` Dan Carpenter
2010-07-24  8:59         ` walter harms
2010-07-24 19:00           ` Lennert Buytenhek
2010-07-25 14:47             ` walter harms
2010-07-25 15:54               ` Lennert Buytenhek

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).