Skip to contentSkip to conversation

fix of mutex locking bug in fops_read

PATCH In review Tobias Lorenz 2 participants 2 messages Mar 14, 2011 – Mar 15, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix of mutex locking bug in fops_read

This patch fixes a mutex locking bug causing userspace processes to hang indefinitely upon reading the radio device for RDS data.

---
 drivers/media/radio/si470x/radio-si470x-common.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/media/radio/si470x/radio-si470x-common.c index 4c69698..41ee757 100644

drivers/media/radio/si470x/radio-si470x-common.c +0 -0
@@ -483,7 +483,6 @@ static ssize_t si470x_fops_read(struct file *file,

char __user *buf,
count /= 3;

/* copy RDS block out of internal buffer and to user buffer */
- mutex_lock(&radio->lock);
while (block_count < count) {
if (radio->rd_index == radio->wr_index)
break;

Signature · 1 line
1.7.2.3
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · Tobias Lorenz

This patch fixes a mutex locking bug causing userspace processes to hang indefinitely upon reading the radio device for RDS data.

---
 drivers/media/radio/si470x/radio-si470x-common.c |    1 -

 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/media/radio/si470x/radio-si470x-common.c +0 -1
index 4c69698..41ee757 100644
@@ -483,7 +483,6 @@ static ssize_t si470x_fops_read(struct file *file,
 char __user *buf,
        count /= 3;
 
        /* copy RDS block out of internal buffer and to user buffer */
-       mutex_lock(&radio->lock);
        while (block_count < count) {
                if (radio->rd_index == radio->wr_index)

                       break;
--
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html