diff options
author | roel kluin <roel.kluin@gmail.com> | 2009-01-09 23:49:04 +0100 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2009-01-09 23:49:04 +0100 |
commit | 23faf63123e306b4a134f6d6c501813f6c8599dc (patch) | |
tree | 2cdc14814e2a0e902b42d0f6a593ec09147a3423 /arch | |
parent | serial: Add driver for the Cell Network Processor serial port NWP device (diff) | |
download | linux-23faf63123e306b4a134f6d6c501813f6c8599dc.tar.xz linux-23faf63123e306b4a134f6d6c501813f6c8599dc.zip |
powerpc/mpc5121: fix NULL test in mpc5121_clk_get utility function.
strcmp on NULL results in a segmentation fault, also, remove the second,
redundant test on dev
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/512x/clock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c index f416014ee727..1bcff94eb924 100644 --- a/arch/powerpc/platforms/512x/clock.c +++ b/arch/powerpc/platforms/512x/clock.c @@ -56,12 +56,12 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id) int dev_match = 0; int id_match = 0; - if (dev == NULL && id == NULL) + if (dev == NULL || id == NULL) return NULL; mutex_lock(&clocks_mutex); list_for_each_entry(p, &clocks, node) { - if (dev && dev == p->dev) + if (dev == p->dev) dev_match++; if (strcmp(id, p->name) == 0) id_match++; |