1. 06 6月, 2017 2 次提交
  2. 19 11月, 2016 1 次提交
  3. 05 2月, 2016 1 次提交
  4. 22 12月, 2015 1 次提交
    • M
      [media] au8522: Avoid memory leak for device config data · aa37763f
      Mauro Carvalho Chehab 提交于
      As reported by kmemleak:
      
      	unreferenced object 0xffff880321e1da40 (size 32):
      	  comm "modprobe", pid 3309, jiffies 4295019569 (age 2359.636s)
      	  hex dump (first 32 bytes):
      	    47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  G...............
      	    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      	  backtrace:
      	    [<ffffffff82278c8e>] kmemleak_alloc+0x4e/0xb0
      	    [<ffffffff8153c08c>] kmem_cache_alloc_trace+0x1ec/0x280
      	    [<ffffffffa13a896a>] au8522_probe+0x19a/0xa30 [au8522_decoder]
      	    [<ffffffff81de0032>] i2c_device_probe+0x2b2/0x490
      	    [<ffffffff81ca7004>] driver_probe_device+0x454/0xd90
      	    [<ffffffff81ca7c1b>] __device_attach_driver+0x17b/0x230
      	    [<ffffffff81ca15da>] bus_for_each_drv+0x11a/0x1b0
      	    [<ffffffff81ca6a4d>] __device_attach+0x1cd/0x2c0
      	    [<ffffffff81ca7d43>] device_initial_probe+0x13/0x20
      	    [<ffffffff81ca451f>] bus_probe_device+0x1af/0x250
      	    [<ffffffff81c9e0f3>] device_add+0x943/0x13b0
      	    [<ffffffff81c9eb7a>] device_register+0x1a/0x20
      	    [<ffffffff81de8626>] i2c_new_device+0x5d6/0x8f0
      	    [<ffffffffa0d88ea4>] v4l2_i2c_new_subdev_board+0x1e4/0x250 [v4l2_common]
      	    [<ffffffffa0d88fe7>] v4l2_i2c_new_subdev+0xd7/0x110 [v4l2_common]
      	    [<ffffffffa13b2f76>] au0828_card_analog_fe_setup+0x2e6/0x3f0 [au0828]
      
      Checking where the error happens:
      	(gdb) list *au8522_probe+0x19a
      	0x99a is in au8522_probe (drivers/media/dvb-frontends/au8522_decoder.c:761).
      	756			printk(KERN_INFO "au8522_decoder attach existing instance.\n");
      	757			break;
      	758		}
      	759
      	760		demod_config = kzalloc(sizeof(struct au8522_config), GFP_KERNEL);
      	761		if (demod_config == NULL) {
      	762			if (instance == 1)
      	763				kfree(state);
      	764			return -ENOMEM;
      	765		}
      
      Shows that the error path is not being handled properly.
      
      The are actually several issues here:
      
      1) config free should have been calling hybrid_tuner_release_state()
      function, by calling au8522_release_state();
      
      2) config is only allocated at the digital part. On the analog one,
      it is received from the caller.
      
      A complex logic could be added to address it, however, it is simpler
      to just embeed config inside the state.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      aa37763f
  5. 07 8月, 2015 1 次提交
  6. 10 6月, 2015 1 次提交
    • M
      [media] dvb: Get rid of typedev usage for enums · 0df289a2
      Mauro Carvalho Chehab 提交于
      The DVB API was originally defined using typedefs. This is against
      Kernel CodingStyle, and there's no good usage here. While we can't
      remove its usage on userspace, we can avoid its usage in Kernelspace.
      
      So, let's do it.
      
      This patch was generated by this shell script:
      
      	for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done
      
      While here, make CodingStyle fixes on the affected lines.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*
      0df289a2
  7. 03 11月, 2014 1 次提交
  8. 14 8月, 2012 1 次提交
  9. 10 8月, 2012 2 次提交
    • D
      [media] au0828: prevent i2c gate from being kept open while in analog mode · 4a03dafc
      Devin Heitmueller 提交于
      The original implementation of the analog support would use an
      i2c_gate_ctrl function when using the digital side of the au8522, but on
      the analog side we would always just force the gate open and leave it
      open all the time.
      
      This can have adverse effects on the xc5000 given the tuner is receiving
      all the spurious i2c traffic (a problem which can be exaggerated due to
      bugs in the au0828 i2c hardware implementation).
      
      Rework the existing hack to only open/close the gate when actually
      talking to the tuner.
      
      This logic might need to be reworked a bit if anybody ever tries to add
      support for a board that has the au0828/au8522 but doesn't have digital
      support implemented (because the i2c_gate_ctrl callback is being set in
      the DVB attach).  However given how few different models are in
      circulation, this can be deferred until such a situation arises (if
      ever).
      Signed-off-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      4a03dafc
    • D
      [media] au8522: Fix off-by-one in SNR table for QAM256 · b0c4878e
      Devin Heitmueller 提交于
      The table of valid SNR values for QAM 256 is off by one, and as a result
      if the SNR is oscillating between 40.0 and 39.9 dB, tools like azap show
      it going back and forth between 40.0 and 0 (misleading some people,
      including myself, to think signal lock is being lost or there is a
      problem with register reads).
      
      Fix the table so that 40.0 dB is properly represented.
      
      Cc: Steven Toth <stoth@kernellabs.com>
      Signed-off-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      b0c4878e
  10. 19 4月, 2012 1 次提交
  11. 20 3月, 2012 1 次提交
  12. 05 1月, 2012 1 次提交
  13. 31 12月, 2011 5 次提交
  14. 07 11月, 2011 1 次提交
  15. 31 3月, 2011 1 次提交
  16. 18 5月, 2010 2 次提交
  17. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  18. 17 6月, 2009 1 次提交
  19. 30 3月, 2009 7 次提交
  20. 13 10月, 2008 1 次提交
  21. 04 9月, 2008 4 次提交
  22. 20 7月, 2008 1 次提交
  23. 27 6月, 2008 2 次提交