summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorAlexey Klimov <klimov.linux@gmail.com>2009-01-25 20:07:28 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-29 09:00:40 -0200
commit7f03a5856c1c32ddc7b6b7a31bd43a4ab8e29f90 (patch)
tree4b98cae8a7ff9ff9e9c3dff20348a4c867b08664 /drivers/media
parent6d9f13c47a009ccbaf40c2e388ab349690dd8000 (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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/radio/radio-mr800.c12
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)
return retval;
}
- mutex_unlock(&radio->lock);
-
radio->muted = 0;
+ mutex_unlock(&radio->lock);
+
return retval;
}
@@ -230,10 +230,10 @@ static int amradio_stop(struct amradio_device *radio)
return retval;
}
- mutex_unlock(&radio->lock);
-
radio->muted = 1;
+ mutex_unlock(&radio->lock);
+
return retval;
}
@@ -284,10 +284,10 @@ static int amradio_setfreq(struct amradio_device *radio, int freq)
return retval;
}
- mutex_unlock(&radio->lock);
-
radio->stereo = 0;
+ mutex_unlock(&radio->lock);
+
return retval;
}