1. 20 4月, 2013 1 次提交
    • D
      staging: net: remove pc300 driver · f33cb17d
      Daniel Borkmann 提交于
      To quote the TODO from staging/net/:
      
        PC300:
      
        The driver is very broken and cannot work with the current TTY
        layer. It is inevitable to convert it to the new TTY API. If no
        one steps in to adopt the driver, it will be removed in the 3.7
        release.
      
      Nothing has changed since more than _one_ year on this driver, thus
      just remove it since we already moved past 3.7. If somebody steps
      up and does a whole rework, he/she, of course, is free to resubmit
      it. Since this is the only one in the net directory, we can remove
      it as well.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f33cb17d
  2. 18 4月, 2013 2 次提交
    • H
      staging: comedi: introduce, and use, comedi_spriv_free() · 2f69915c
      H Hartley Sweeten 提交于
      The comedi_subdevice 'private' variable is a void * that is available
      for the subdevice to use in manner. It's common in comedi drivers for
      the driver to allocate memory for a subdevice and store the pointer
      to that memory in the 'private' variable. It's then the responsibility
      of the driver to free that memory when the device is detached.
      
      Due to how the attach/detach works in comedi, the drivers need to do
      some sanity checking before they can free the allocated memory during
      the detach.
      
      Introduce a helper function, comedi_spriv_free(), to handle freeing
      the private data allocated for a subdevice. This allows moving all the
      sanity checks into the helper function and makes it safe to call
      with any context. It also allows removing some of the boilerplate
      code in the (*detach) functions.
      
      Remove the subdev_8255_cleanup() export in the 8255 subdevice driver
      as well as the addi_watchdog_cleanup() export in the addi_watchdog
      driver and use the new helper instead.
      
      The amplc_dio200_common driver uses a number of local helper functions
      to free the private data for it's subdevices. Remove those as well and
      use the new helper.
      Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Reviewed-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2f69915c
    • H
      staging: comedi: unionxx5: fix memory leak during subdevice init · f4362867
      H Hartley Sweeten 提交于
      In the subdevice init during the attach of this driver, private data
      is allocated for each subdevice. The pointer to this data is then
      saved in the subdevice 's->private' so it can be free'ed during the
      detach.
      
      In __unioxx5_subdev_init() an error path exists that can happen before
      the allocated pointer is saved in s->private. Make sure the allocated
      memory is free'ed before returning the error.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4362867
  3. 16 4月, 2013 7 次提交
  4. 15 4月, 2013 11 次提交
  5. 14 4月, 2013 3 次提交
    • N
      watchdog: Revert the AT91RM9200_WATCHDOG dependency · 09549cd0
      Nicolas Ferre 提交于
      Compiling the at91rm9200_wdt.c driver without at91rm9200
      support was leading to several errors:
      
      drivers/built-in.o: In function `at91_wdt_close':
      at91_adc.c:(.text+0xc9fe4): undefined reference to `at91_st_base'
      drivers/built-in.o: In function `at91_wdt_write':
      at91_adc.c:(.text+0xca004): undefined reference to `at91_st_base'
      drivers/built-in.o: In function `at91wdt_shutdown':
      at91_adc.c:(.text+0xca01c): undefined reference to `at91_st_base'
      drivers/built-in.o: In function `at91wdt_suspend':
      at91_adc.c:(.text+0xca038): undefined reference to `at91_st_base'
      drivers/built-in.o: In function `at91_wdt_open':
      at91_adc.c:(.text+0xca0cc): undefined reference to `at91_st_base'
      drivers/built-in.o:at91_adc.c:(.text+0xca2c8): more undefined references to
      `at91_st_base' follow
      
      So, reverting the modification of the "depends" Kconfig line
      introduced by patch a6a1bcd3 (watchdog: at91rm9200: add DT support)
      seems to be the good solution.
      Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Acked-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
      09549cd0
    • S
      vfs: Revert spurious fix to spinning prevention in prune_icache_sb · 5b55d708
      Suleiman Souhlal 提交于
      Revert commit 62a3ddef ("vfs: fix spinning prevention in prune_icache_sb").
      
      This commit doesn't look right: since we are looking at the tail of the
      list (sb->s_inode_lru.prev) if we want to skip an inode, we should put
      it back at the head of the list instead of the tail, otherwise we will
      keep spinning on it.
      
      Discovered when investigating why prune_icache_sb came top in perf
      reports of a swapping load.
      Signed-off-by: NSuleiman Souhlal <suleiman@google.com>
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Cc: stable@vger.kernel.org # v3.2+
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b55d708
    • L
      kobject: fix kset_find_obj() race with concurrent last kobject_put() · a49b7e82
      Linus Torvalds 提交于
      Anatol Pomozov identified a race condition that hits module unloading
      and re-loading.  To quote Anatol:
      
       "This is a race codition that exists between kset_find_obj() and
        kobject_put().  kset_find_obj() might return kobject that has refcount
        equal to 0 if this kobject is freeing by kobject_put() in other
        thread.
      
        Here is timeline for the crash in case if kset_find_obj() searches for
        an object tht nobody holds and other thread is doing kobject_put() on
        the same kobject:
      
          THREAD A (calls kset_find_obj())     THREAD B (calls kobject_put())
          splin_lock()
                                               atomic_dec_return(kobj->kref), counter gets zero here
                                               ... starts kobject cleanup ....
                                               spin_lock() // WAIT thread A in kobj_kset_leave()
          iterate over kset->list
          atomic_inc(kobj->kref) (counter becomes 1)
          spin_unlock()
                                               spin_lock() // taken
                                               // it does not know that thread A increased counter so it
                                               remove obj from list
                                               spin_unlock()
                                               vfree(module) // frees module object with containing kobj
      
          // kobj points to freed memory area!!
          kobject_put(kobj) // OOPS!!!!
      
        The race above happens because module.c tries to use kset_find_obj()
        when somebody unloads module.  The module.c code was introduced in
        commit 6494a93d"
      
      Anatol supplied a patch specific for module.c that worked around the
      problem by simply not using kset_find_obj() at all, but rather than make
      a local band-aid, this just fixes kset_find_obj() to be thread-safe
      using the proper model of refusing the get a new reference if the
      refcount has already dropped to zero.
      
      See examples of this proper refcount handling not only in the kref
      documentation, but in various other equivalent uses of this pattern by
      grepping for atomic_inc_not_zero().
      
      [ Side note: the module race does indicate that module loading and
        unloading is not properly serialized wrt sysfs information using the
        module mutex.  That may require further thought, but this is the
        correct fix at the kobject layer regardless. ]
      Reported-analyzed-and-tested-by: NAnatol Pomozov <anatol.pomozov@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a49b7e82
  6. 13 4月, 2013 16 次提交