Skip to content

Commit

Permalink
[POWERPC] qe_lib: fix few fluffy negligences
Browse files Browse the repository at this point in the history
One is intoduced by me (of_node_put() absence) and another was
present already (not checking for NULL).

Found by Stephen Rothwell.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
  • Loading branch information
Anton Vorontsov authored and Kumar Gala committed Feb 6, 2008
1 parent e1664ee commit d8985fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/powerpc/sysdev/qe_lib/qe.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ phys_addr_t get_qe_base(void)
{
struct device_node *qe;
unsigned int size;
const void *prop;
const u32 *prop;

if (qebase != -1)
return qebase;
Expand All @@ -79,7 +79,8 @@ phys_addr_t get_qe_base(void)
}

prop = of_get_property(qe, "reg", &size);
qebase = of_translate_address(qe, prop);
if (prop && size >= sizeof(*prop))
qebase = of_translate_address(qe, prop);
of_node_put(qe);

return qebase;
Expand Down Expand Up @@ -172,10 +173,9 @@ unsigned int get_brg_clk(void)
}

prop = of_get_property(qe, "brg-frequency", &size);
if (!prop || size != sizeof(*prop))
return brg_clk;
if (prop && size == sizeof(*prop))
brg_clk = *prop;

brg_clk = *prop;
of_node_put(qe);

return brg_clk;
Expand Down

0 comments on commit d8985fd

Please sign in to comment.