diff options
| author | Alexey Klimov <klimov.linux@gmail.com> | 2009-01-25 18:07:28 -0500 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-29 06:00:40 -0500 |
| commit | 7f03a5856c1c32ddc7b6b7a31bd43a4ab8e29f90 (patch) | |
| tree | 4b98cae8a7ff9ff9e9c3dff20348a4c867b08664 | |
| parent | 6d9f13c47a009ccbaf40c2e388ab349690dd8000 (diff) | |
V4L/DVB (10317): radio-mr800: fix radio->muted and radio->stereo
Move radio->muted and radio->stereo in section where radio mutex is
locked to avoid possible race condition problems or access to memory.
Thanks to David Ellingsworth <david@identd.dyndns.org> for pointing to
this weak place in driver.
Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
| -rw-r--r-- | drivers/media/radio/radio-mr800.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 0747dc8862b0..fdfc7bf86b9e 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c | |||
| @@ -194,10 +194,10 @@ static int amradio_start(struct amradio_device *radio) | |||
| 194 | return retval; | 194 | return retval; |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | mutex_unlock(&radio->lock); | ||
| 198 | |||
| 199 | radio->muted = 0; | 197 | radio->muted = 0; |
| 200 | 198 | ||
| 199 | mutex_unlock(&radio->lock); | ||
| 200 | |||
| 201 | return retval; | 201 | return retval; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| @@ -230,10 +230,10 @@ static int amradio_stop(struct amradio_device *radio) | |||
| 230 | return retval; | 230 | return retval; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | mutex_unlock(&radio->lock); | ||
| 234 | |||
| 235 | radio->muted = 1; | 233 | radio->muted = 1; |
| 236 | 234 | ||
| 235 | mutex_unlock(&radio->lock); | ||
| 236 | |||
| 237 | return retval; | 237 | return retval; |
| 238 | } | 238 | } |
| 239 | 239 | ||
| @@ -284,10 +284,10 @@ static int amradio_setfreq(struct amradio_device *radio, int freq) | |||
| 284 | return retval; | 284 | return retval; |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | mutex_unlock(&radio->lock); | ||
| 288 | |||
| 289 | radio->stereo = 0; | 287 | radio->stereo = 0; |
| 290 | 288 | ||
| 289 | mutex_unlock(&radio->lock); | ||
| 290 | |||
| 291 | return retval; | 291 | return retval; |
| 292 | } | 292 | } |
| 293 | 293 | ||
