Fix radio-si4713 driver, fix hang: echo 0 > lock
authorPali Rohár <pali.rohar@gmail.com>
Thu, 28 Jun 2012 14:17:00 +0000 (16:17 +0200)
committerPali Rohár <pali.rohar@gmail.com>
Thu, 28 Jun 2012 14:17:00 +0000 (16:17 +0200)
kernel-power-2.6.28/debian/patches/radio-si4713.diff

index c527e70..d438485 100644 (file)
  
  /*
   * Sysfs properties
-@@ -193,17 +180,7 @@ static ssize_t si4713_lock_write(struct
+@@ -193,17 +180,15 @@ static ssize_t si4713_lock_write(struct
                                const char *buf,
                                size_t count)
  {
--      int l;
--
+       int l;
 -      if (config_locked)
 -              return -EPERM;
 -
--      sscanf(buf, "%d", &l);
--
+       sscanf(buf, "%d", &l);
 -      if (l != 0)
 -              config_locked = 1;
--
--      return count;
-+      return sscanf(buf, "%d", &config_locked);
++      if (l != 0 && l != 1)
++              return -EINVAL;
++      config_locked = l;
+       return count;
  }
  
  static ssize_t si4713_lock_read(struct device *dev,