Skip to contentSkip to conversation

check for return value of clk_get() in mpc512x_can_get_clock()

DISCUSSION Andrej Krutak 2 participants 2 messages Feb 23, 2011 – Feb 25, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

just wanted to inform you - in the mpc512x_can_get_clock() function (drivers/net/can/mscan/mpc5xxx_can.c), there are calls to clg_get(), and later checks

if (!sys_clk) {
and
if (!ref_clk) {

but these should be

if (IS_ERR(sys_clk)) {
and
if (IS_ERR(ref_clk)) {

(otherwise you'll get an oops if something goes wrong with clg_get()).

Signature · 3 lines
Best regards | S pozdravom | Mit freundlichen Grüßen

Andrej Krutak

A message that is not in the archive (sent off-list or not yet received): 201102231435.53991.andrej.krutak-uSbOeAmDUekAvxtiuMwx3w@public.gmane.org

#2 lore raw

Hi,

Quoted 10 lines · Andrej Krutak

Hi,

just wanted to inform you - in the mpc512x_can_get_clock() function (drivers/net/can/mscan/mpc5xxx_can.c), there are calls to clg_get(), and later checks

if (!sys_clk) {
and
if (!ref_clk) {

Quoted 7 lines

but these should be

if (IS_ERR(sys_clk)) {
and
if (IS_ERR(ref_clk)) {

(otherwise you'll get an oops if something goes wrong with clg_get()).

Thanks for the info. I'm going to prepare a patch.

Wolfgang.