From b5d22bdc0845f71c880bc68a86827837149a647f Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 23 Jul 2010 01:05:05 +0000 Subject: [PATCH] mv643xx_eth: potential null dereference 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 6fde3c3026e8 "mv643xx_eth: use sw csum for big packets" Signed-off-by: Dan Carpenter Acked-by: Lennert Buytenhek Signed-off-by: David S. Miller --- drivers/net/mv643xx_eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 2fcdb1e1b99d0..2d488abcf62d7 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 != NULL && pd->tx_csum_limit) ? + pd->tx_csum_limit : 9 * 1024; infer_hw_params(msp); platform_set_drvdata(pdev, msp); -- 2.39.5