summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAlexey Klimov2009-01-26 00:07:28 +0100
committerMauro Carvalho Chehab2009-01-29 12:00:40 +0100
commit7f03a5856c1c32ddc7b6b7a31bd43a4ab8e29f90 (patch)
tree4b98cae8a7ff9ff9e9c3dff20348a4c867b08664 /drivers/media
parentV4L/DVB (10314): cx25840: ignore TUNER_SET_CONFIG in the command callback. (diff)
downloadkernel-qcow2-linux-7f03a5856c1c32ddc7b6b7a31bd43a4ab8e29f90.tar.gz
kernel-qcow2-linux-7f03a5856c1c32ddc7b6b7a31bd43a4ab8e29f90.tar.xz
kernel-qcow2-linux-7f03a5856c1c32ddc7b6b7a31bd43a4ab8e29f90.zip
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;
}