Skip to contentSkip to conversation

null pointer access in error path of lgdt3305 driver

DISCUSSION Matthias Schwarzott 2 participants 2 messages Mar 12, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi Michael!

Looking at your new lgdt3305 driver, I noticed that the error path of lgdt3305_attach, that is also jumped to kzalloc errors, sets state->frontend.demodulator_priv to NULL.

That will oops in case state is NULL. So you either need two goto labels for failures or just return in case kzalloc fails.

Regards
Matthias

#1 lore raw
Quoted 8 lines · Matthias Schwarzott

Hi Michael!

Looking at your new lgdt3305 driver, I noticed that the error path of lgdt3305_attach, that is also jumped to kzalloc errors, sets state->frontend.demodulator_priv to NULL.

That will oops in case state is NULL. So you either need two goto labels for failures or just return in case kzalloc fails.

Patches welcomed. :-)

Regards,

David Ellingsworth