Details

user warning: Got error 28 from storage engine query: SELECT t.*,v.weight AS v_weight_unused FROM term_node r INNER JOIN term_data t ON r.tid = t.tid INNER JOIN vocabulary v ON t.vid = v.vid WHERE r.vid = 109 ORDER BY v.weight, t.weight, t.name in /opt/drupal-6.33/modules/taxonomy/taxonomy.module on line 640.

[Home]

Issue of the Implementation # L0025

Brief

drivers/media/radio/si470x/radio-si470x-common.c: double mutex_lock in si470x_fops_read()

Detailed Description

  • First mutex_lock(&radio->lock) in line 441.
  • Second mutex_lock(&radio->lock) in line 462.
  •  433static ssize_t si470x_fops_read(struct file *file, char __user *buf,
     434                size_t count, loff_t *ppos)
     435{
    ....
     441        mutex_lock(&radio->lock);
     442        if ((radio->registers[SYSCONFIG1] & SYSCONFIG1_RDS) == 0)
     443                si470x_rds_on(radio);
     444
     445        /* block if no new data available */
     446        while (radio->wr_index == radio->rd_index) {
     447                if (file->f_flags & O_NONBLOCK) {
     448                        retval = -EWOULDBLOCK;
     449                        goto done;
     450                }
     451                if (wait_event_interruptible(radio->read_queue,
     452                        radio->wr_index != radio->rd_index) < 0) {
     453                        retval = -EINTR;
     454                        goto done;
     455                }
     456        }
     457
     458        /* calculate block count from byte count */
     459        count /= 3;
     460
     461        /* copy RDS block out of internal buffer and to user buffer */
     462        mutex_lock(&radio->lock);
    

    Possible solutions

     drivers/media/radio/si470x/radio-si470x-common.c |    1 -
     1 files changed, 0 insertions(+), 1 deletions(-)
    diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
    index 60c176f..38ae6cd 100644
    --- a/drivers/media/radio/si470x/radio-si470x-common.c
    +++ b/drivers/media/radio/si470x/radio-si470x-common.c
    @@ -460,7 +460,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;
    -- 
    

    Component

    linux-kernel 2.6.37

    Accepted

    https://lkml.org/lkml/2011/1/23/11
    commit

    Status

    Fixed in kernel 2.6.39-rc1

    [Home]