Bug 14238 - found a possible null pointer dereference in file linux-2.6.31/sound/soc/soc-jack.c
Summary: found a possible null pointer dereference in file linux-2.6.31/sound/soc/soc-...
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(OSS) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_sound
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-26 17:09 UTC by Martin Ettl
Modified: 2012-06-13 18:51 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.31
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Martin Ettl 2009-09-26 17:09:17 UTC
Hello,

i have checked the linux kernel with the static code analysis tool cppcheck. It found a possible nullpointer dereference in file linux-2.6.31/sound/soc/soc-jack.c
at line 61. 

Take a look at the code:

void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
{
61	struct snd_soc_codec *codec = jack->card->codec;
	struct snd_soc_jack_pin *pin;
	int enable;
	int oldstatus;

66	if (!jack) {
		WARN_ON_ONCE(!jack);
		return;
	}
....

Indeed, the pointer 'jack' is used at line 61. Then at line 66 it is checked for NULL.

Best regards

Martin

Note You need to log in before you can comment on or make changes to this bug.