summaryrefslogtreecommitdiff
path: root/drivers/net/mv643xx_eth.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-07-23 01:05:05 +0000
committerDavid S. Miller <davem@davemloft.net>2010-07-23 13:05:12 -0700
commit50a749c1f2fc8f03232c174c9dbc78a78f9bebfd (patch)
tree5a2c5d4d8281f1adba05ddce4312d355e0572015 /drivers/net/mv643xx_eth.c
parentf89f5d0e94e001e0a09bd433c0c0f089eaf0dea9 (diff)
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 9b2c2ff7a1c0 "mv643xx_eth: use sw csum for big packets" Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r--drivers/net/mv643xx_eth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 2fcdb1e1b99d..2d488abcf62d 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);