commit | 23f75004d8a981927d32d150c88e16ec50c11fdd | [log] [tgz] |
---|---|---|
author | Johan Hedberg <johan.hedberg@nokia.com> | Fri Apr 02 22:41:53 2010 +0300 |
committer | Johan Hedberg <johan.hedberg@nokia.com> | Fri Apr 02 22:41:53 2010 +0300 |
tree | 6f727555199124fa56370c8a2c2de9c07b5f2665 | |
parent | 895eea1347243bae4aa65eea8531452fe5dd81ea [diff] |
Fix invalid memory access in headset_get_nrec when hs->slc is NULL headset_get_nrec might get called when there's no SLC and it should return the default NREC value in that case which is TRUE.
diff --git a/audio/headset.c b/audio/headset.c index 17938f7..1d9f8f2 100644 --- a/audio/headset.c +++ b/audio/headset.c
@@ -2685,6 +2685,9 @@ { struct headset *hs = dev->headset; + if (!hs->slc) + return TRUE; + return hs->slc->nrec; }