1. 05 5月, 2018 1 次提交
  2. 17 4月, 2018 1 次提交
    • M
      media: dvb_frontend: fix locking issues at dvb_frontend_get_event() · 76d81243
      Mauro Carvalho Chehab 提交于
      As warned by smatch:
      	drivers/media/dvb-core/dvb_frontend.c:314 dvb_frontend_get_event() warn: inconsistent returns 'sem:&fepriv->sem'.
      	  Locked on:   line 288
      	               line 295
      	               line 306
      	               line 314
      	  Unlocked on: line 303
      
      The lock implementation for get event is wrong, as, if an
      interrupt occurs, down_interruptible() will fail, and the
      routine will call up() twice when userspace calls the ioctl
      again.
      
      The bad code is there since when Linux migrated to git, in
      2005.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      76d81243
  3. 04 4月, 2018 1 次提交
  4. 22 3月, 2018 1 次提交
    • M
      media: dvb_frontend: add proper __user annotations · f44d6107
      Mauro Carvalho Chehab 提交于
      Solves those warnings:
      	drivers/media/dvb-core/dvb_frontend.c:2297:39: warning: incorrect type in argument 1 (different address spaces)
      	drivers/media/dvb-core/dvb_frontend.c:2297:39:    expected void const [noderef] <asn:1>*<noident>
      	drivers/media/dvb-core/dvb_frontend.c:2297:39:    got struct dtv_property *props
      	drivers/media/dvb-core/dvb_frontend.c:2331:39: warning: incorrect type in argument 1 (different address spaces)
      	drivers/media/dvb-core/dvb_frontend.c:2331:39:    expected void const [noderef] <asn:1>*<noident>
      	drivers/media/dvb-core/dvb_frontend.c:2331:39:    got struct dtv_property *props
      
      No functional changes.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      f44d6107
  5. 12 2月, 2018 1 次提交
    • L
      vfs: do bulk POLL* -> EPOLL* replacement · a9a08845
      Linus Torvalds 提交于
      This is the mindless scripted replacement of kernel use of POLL*
      variables as described by Al, done by this script:
      
          for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
              L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
              for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
          done
      
      with de-mangling cleanups yet to come.
      
      NOTE! On almost all architectures, the EPOLL* constants have the same
      values as the POLL* constants do.  But they keyword here is "almost".
      For various bad reasons they aren't the same, and epoll() doesn't
      actually work quite correctly in some cases due to this on Sparc et al.
      
      The next patch from Al will sort out the final differences, and we
      should be all done.
      Scripted-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9a08845
  6. 29 12月, 2017 1 次提交
  7. 19 12月, 2017 1 次提交
  8. 13 12月, 2017 4 次提交
  9. 12 12月, 2017 2 次提交
  10. 28 11月, 2017 1 次提交
  11. 27 11月, 2017 1 次提交
  12. 07 11月, 2017 2 次提交
    • M
      dvb_frontend: don't use-after-free the frontend struct · b1cb7372
      Mauro Carvalho Chehab 提交于
      dvb_frontend_invoke_release() may free the frontend struct.
      So, the free logic can't update it anymore after calling it.
      
      That's OK, as __dvb_frontend_free() is called only when the
      krefs are zeroed, so nobody is using it anymore.
      
      That should fix the following KASAN error:
      
      The KASAN report looks like this (running on kernel 3e0cc09a (4.14-rc5+)):
      ==================================================================
      BUG: KASAN: use-after-free in __dvb_frontend_free+0x113/0x120
      Write of size 8 at addr ffff880067d45a00 by task kworker/0:1/24
      
      CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.14.0-rc5-43687-g06ab8a23e0e6 #545
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      Workqueue: usb_hub_wq hub_event
      Call Trace:
       __dump_stack lib/dump_stack.c:16
       dump_stack+0x292/0x395 lib/dump_stack.c:52
       print_address_description+0x78/0x280 mm/kasan/report.c:252
       kasan_report_error mm/kasan/report.c:351
       kasan_report+0x23d/0x350 mm/kasan/report.c:409
       __asan_report_store8_noabort+0x1c/0x20 mm/kasan/report.c:435
       __dvb_frontend_free+0x113/0x120 drivers/media/dvb-core/dvb_frontend.c:156
       dvb_frontend_put+0x59/0x70 drivers/media/dvb-core/dvb_frontend.c:176
       dvb_frontend_detach+0x120/0x150 drivers/media/dvb-core/dvb_frontend.c:2803
       dvb_usb_adapter_frontend_exit+0xd6/0x160 drivers/media/usb/dvb-usb/dvb-usb-dvb.c:340
       dvb_usb_adapter_exit drivers/media/usb/dvb-usb/dvb-usb-init.c:116
       dvb_usb_exit+0x9b/0x200 drivers/media/usb/dvb-usb/dvb-usb-init.c:132
       dvb_usb_device_exit+0xa5/0xf0 drivers/media/usb/dvb-usb/dvb-usb-init.c:295
       usb_unbind_interface+0x21c/0xa90 drivers/usb/core/driver.c:423
       __device_release_driver drivers/base/dd.c:861
       device_release_driver_internal+0x4f1/0x5c0 drivers/base/dd.c:893
       device_release_driver+0x1e/0x30 drivers/base/dd.c:918
       bus_remove_device+0x2f4/0x4b0 drivers/base/bus.c:565
       device_del+0x5c4/0xab0 drivers/base/core.c:1985
       usb_disable_device+0x1e9/0x680 drivers/usb/core/message.c:1170
       usb_disconnect+0x260/0x7a0 drivers/usb/core/hub.c:2124
       hub_port_connect drivers/usb/core/hub.c:4754
       hub_port_connect_change drivers/usb/core/hub.c:5009
       port_event drivers/usb/core/hub.c:5115
       hub_event+0x1318/0x3740 drivers/usb/core/hub.c:5195
       process_one_work+0xc73/0x1d90 kernel/workqueue.c:2119
       worker_thread+0x221/0x1850 kernel/workqueue.c:2253
       kthread+0x363/0x440 kernel/kthread.c:231
       ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431
      
      Allocated by task 24:
       save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
       save_stack+0x43/0xd0 mm/kasan/kasan.c:447
       set_track mm/kasan/kasan.c:459
       kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
       kmem_cache_alloc_trace+0x11e/0x2d0 mm/slub.c:2772
       kmalloc ./include/linux/slab.h:493
       kzalloc ./include/linux/slab.h:666
       dtt200u_fe_attach+0x4c/0x110 drivers/media/usb/dvb-usb/dtt200u-fe.c:212
       dtt200u_frontend_attach+0x35/0x80 drivers/media/usb/dvb-usb/dtt200u.c:136
       dvb_usb_adapter_frontend_init+0x32b/0x660 drivers/media/usb/dvb-usb/dvb-usb-dvb.c:286
       dvb_usb_adapter_init drivers/media/usb/dvb-usb/dvb-usb-init.c:86
       dvb_usb_init drivers/media/usb/dvb-usb/dvb-usb-init.c:162
       dvb_usb_device_init+0xf73/0x17f0 drivers/media/usb/dvb-usb/dvb-usb-init.c:277
       dtt200u_usb_probe+0xa1/0xe0 drivers/media/usb/dvb-usb/dtt200u.c:155
       usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361
       really_probe drivers/base/dd.c:413
       driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
       __device_attach_driver+0x230/0x290 drivers/base/dd.c:653
       bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
       __device_attach+0x26b/0x3c0 drivers/base/dd.c:710
       device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
       bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
       device_add+0xd0b/0x1660 drivers/base/core.c:1835
       usb_set_configuration+0x104e/0x1870 drivers/usb/core/message.c:1932
       generic_probe+0x73/0xe0 drivers/usb/core/generic.c:174
       usb_probe_device+0xaf/0xe0 drivers/usb/core/driver.c:266
       really_probe drivers/base/dd.c:413
       driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
       __device_attach_driver+0x230/0x290 drivers/base/dd.c:653
       bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
       __device_attach+0x26b/0x3c0 drivers/base/dd.c:710
       device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
       bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
       device_add+0xd0b/0x1660 drivers/base/core.c:1835
       usb_new_device+0x7b8/0x1020 drivers/usb/core/hub.c:2457
       hub_port_connect drivers/usb/core/hub.c:4903
       hub_port_connect_change drivers/usb/core/hub.c:5009
       port_event drivers/usb/core/hub.c:5115
       hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195
       process_one_work+0xc73/0x1d90 kernel/workqueue.c:2119
       worker_thread+0x221/0x1850 kernel/workqueue.c:2253
       kthread+0x363/0x440 kernel/kthread.c:231
       ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431
      
      Freed by task 24:
       save_stack_trace+0x1b/0x20 arch/x86/kernel/stacktrace.c:59
       save_stack+0x43/0xd0 mm/kasan/kasan.c:447
       set_track mm/kasan/kasan.c:459
       kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:524
       slab_free_hook mm/slub.c:1390
       slab_free_freelist_hook mm/slub.c:1412
       slab_free mm/slub.c:2988
       kfree+0xf6/0x2f0 mm/slub.c:3919
       dtt200u_fe_release+0x3c/0x50 drivers/media/usb/dvb-usb/dtt200u-fe.c:202
       dvb_frontend_invoke_release.part.13+0x1c/0x30 drivers/media/dvb-core/dvb_frontend.c:2790
       dvb_frontend_invoke_release drivers/media/dvb-core/dvb_frontend.c:2789
       __dvb_frontend_free+0xad/0x120 drivers/media/dvb-core/dvb_frontend.c:153
       dvb_frontend_put+0x59/0x70 drivers/media/dvb-core/dvb_frontend.c:176
       dvb_frontend_detach+0x120/0x150 drivers/media/dvb-core/dvb_frontend.c:2803
       dvb_usb_adapter_frontend_exit+0xd6/0x160 drivers/media/usb/dvb-usb/dvb-usb-dvb.c:340
       dvb_usb_adapter_exit drivers/media/usb/dvb-usb/dvb-usb-init.c:116
       dvb_usb_exit+0x9b/0x200 drivers/media/usb/dvb-usb/dvb-usb-init.c:132
       dvb_usb_device_exit+0xa5/0xf0 drivers/media/usb/dvb-usb/dvb-usb-init.c:295
       usb_unbind_interface+0x21c/0xa90 drivers/usb/core/driver.c:423
       __device_release_driver drivers/base/dd.c:861
       device_release_driver_internal+0x4f1/0x5c0 drivers/base/dd.c:893
       device_release_driver+0x1e/0x30 drivers/base/dd.c:918
       bus_remove_device+0x2f4/0x4b0 drivers/base/bus.c:565
       device_del+0x5c4/0xab0 drivers/base/core.c:1985
       usb_disable_device+0x1e9/0x680 drivers/usb/core/message.c:1170
       usb_disconnect+0x260/0x7a0 drivers/usb/core/hub.c:2124
       hub_port_connect drivers/usb/core/hub.c:4754
       hub_port_connect_change drivers/usb/core/hub.c:5009
       port_event drivers/usb/core/hub.c:5115
       hub_event+0x1318/0x3740 drivers/usb/core/hub.c:5195
       process_one_work+0xc73/0x1d90 kernel/workqueue.c:2119
       worker_thread+0x221/0x1850 kernel/workqueue.c:2253
       kthread+0x363/0x440 kernel/kthread.c:231
       ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431
      
      The buggy address belongs to the object at ffff880067d45500
       which belongs to the cache kmalloc-2048 of size 2048
      The buggy address is located 1280 bytes inside of
       2048-byte region [ffff880067d45500, ffff880067d45d00)
      The buggy address belongs to the page:
      page:ffffea00019f5000 count:1 mapcount:0 mapping:          (null)
      index:0x0 compound_mapcount: 0
      flags: 0x100000000008100(slab|head)
      raw: 0100000000008100 0000000000000000 0000000000000000 00000001000f000f
      raw: dead000000000100 dead000000000200 ffff88006c002d80 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff880067d45900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff880067d45980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff880067d45a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
       ffff880067d45a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff880067d45b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ==================================================================
      
      Fixes: ead66600 ("media: dvb_frontend: only use kref after initialized")
      Reported-by: NAndrey Konovalov <andreyknvl@google.com>
      Suggested-by: NMatthias Schwarzott <zzam@gentoo.org>
      Tested-by: NAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      b1cb7372
    • D
      media: dvb-core: always call invoke_release() in fe_free() · 62229de1
      Daniel Scheller 提交于
      Follow-up to: ead66600 ("media: dvb_frontend: only use kref after initialized")
      
      The aforementioned commit fixed refcount OOPSes when demod driver attaching
      succeeded but tuner driver didn't. However, the use count of the attached
      demod drivers don't go back to zero and thus couldn't be cleanly unloaded.
      Improve on this by calling dvb_frontend_invoke_release() in
      __dvb_frontend_free() regardless of fepriv being NULL, instead of returning
      when fepriv is NULL. This is safe to do since _invoke_release() will check
      for passed pointers being valid before calling the .release() function.
      
      [mchehab@s-opensource.com: changed the logic a little bit to reduce
       conflicts with another bug fix patch under review]
      Fixes: ead66600 ("media: dvb_frontend: only use kref after initialized")
      Signed-off-by: NDaniel Scheller <d.scheller@gmx.net>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      62229de1
  13. 12 10月, 2017 11 次提交
  14. 05 9月, 2017 1 次提交
  15. 28 8月, 2017 2 次提交
  16. 02 3月, 2017 1 次提交
  17. 03 2月, 2017 1 次提交
    • S
      [media] media: Protect enable_source and disable_source handler code paths · 90cd366b
      Shuah Khan 提交于
      Drivers might try to access and run enable_source and disable_source
      handlers when the driver that implements these handlers is clearing
      the handlers during its unregister.
      
      Fix the following race condition:
      
      process 1				process 2
      
      request video streaming			unbind au0828
      v4l2 checks if tuner is free
      ...					...
      
      					au0828_unregister_media_device()
      ...					...
      					(doesn't hold graph_mutex)
      					mdev->enable_source = NULL;
      if (mdev && mdev->enable_source)	mdev->disable_source = NULL;
      	mdev->enable_source()
      (enable_source holds graph_mutex)
      
      As shown above enable_source check is done without holding the graph_mutex.
      If unbind happens to be in progress, au0828 could clear enable_source and
      disable_source handlers leading to null pointer de-reference.
      
      Fix it by protecting enable_source and disable_source set and clear and
      protecting enable_source and disable_source handler access and the call
      itself.
      
      process 1				process 2
      
      request video streaming			unbind au0828
      v4l2 checks if tuner is free
      ...					...
      
      					au0828_unregister_media_device()
      ...					...
      					(hold graph_mutex while clearing)
      					mdev->enable_source = NULL;
      if (mdev)				mdev->disable_source = NULL;
      (hold graph_mutex to check and
       call enable_source)
          if (mdev->enable_source)
      	mdev->enable_source()
      
      If graph_mutex is held to just heck for handler being null and needs to be
      released before calling the handler, there will be another window for the
      handlers to be cleared. Hence, enable_source and disable_source handlers
      no longer hold the graph_mutex and expect callers to hold it to avoid
      forcing them release the graph_mutex before calling the handlers.
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      90cd366b
  18. 27 1月, 2017 1 次提交
    • S
      [media] media: Drop FSF's postal address from the source code files · bcb63314
      Sakari Ailus 提交于
      Drop the FSF's postal address from the source code files that typically
      contain mostly the license text. Of the 628 removed instances, 578 are
      outdated.
      
      The patch has been created with the following command without manual edits:
      
      git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \
      	drivers/media/ include/media|while read i; do i=$i perl -e '
      open(F,"< $ENV{i}");
      $a=join("", <F>);
      $a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m
      	&& $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m;
      close(F);
      open(F, "> $ENV{i}");
      print F $a;
      close(F);'; done
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      bcb63314
  19. 19 11月, 2016 6 次提交
    • M
      Revert "[media] dvb_frontend: merge duplicate dvb_tuner_ops.release implementations" · f2709c20
      Mauro Carvalho Chehab 提交于
      While this patch sounded a good idea, unfortunately, it causes
      bad dependencies, as drivers that would otherwise work without
      the DVB core will now break:
      
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/tea5767.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/tea5761.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/tda827x.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/tda18218.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/qt1010.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/mt2266.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/mt20xx.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/mt2060.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/mc44s803.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/fc0013.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/fc0012.ko] undefined!
      ERROR: "dvb_tuner_simple_release" [drivers/media/tuners/fc0011.ko] undefined!
      
      So, we have to revert it.
      
      Note: as the argument for the release ops changed from "int"
      to "void", we needed to change it at the revert patch, to
      avoid compilation issues like:
      	drivers/media/tuners/tea5767.c:437:23: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
      	  .release           = tea5767_release,
      	                       ^~~~~~~~~~~~~~~
      
      This reverts commit 22a613e8.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      f2709c20
    • M
      [media] dvb_frontend: move kref to struct dvb_frontend · 1f862a68
      Max Kellermann 提交于
      This commit amends my old commit fe35637b ("[media] dvb_frontend:
      eliminate blocking wait in dvb_unregister_frontend()"), which added
      kref to struct dvb_frontend_private.  It turned out that there are
      several use-after-free bugs left, which affect the struct
      dvb_frontend.  Protecting it with kref also protects struct
      dvb_frontend_private, so we can simply move it.
      
      This is how the use-after-free looks like in KASAN:
      
          BUG: KASAN: use-after-free in string+0x60/0xb1 at addr ffff880033bd9fc0
          Read of size 1 by task kworker/0:2/617
          CPU: 0 PID: 617 Comm: kworker/0:2 Not tainted 4.8.0-rc1-hosting+ #60
          Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
          Workqueue: usb_hub_wq hub_event
           0000000000000000 ffff880033757218 ffffffff81394e50 ffff880033bd9fd0
           ffff880035c03b00 ffff880033757240 ffffffff811f271d ffff880033bd9fc0
           1ffff1000677b3f8 ffffed000677b3f8 ffff8800337572b8 ffffffff811f2afe
          Call Trace:
           [...]
           [<ffffffff813a2d2f>] vsnprintf+0x39d/0x7e9
           [<ffffffff813993f9>] add_uevent_var+0x10f/0x1dc
           [<ffffffff814fe5ca>] rc_dev_uevent+0x55/0x6f
           [<ffffffff814438f8>] dev_uevent+0x2e1/0x316
           [<ffffffff81399744>] kobject_uevent_env+0x27e/0x701
           [<ffffffff81399bd2>] kobject_uevent+0xb/0xd
           [<ffffffff81443445>] device_del+0x322/0x383
           [<ffffffff81500c0c>] rc_unregister_device+0x98/0xc3
           [<ffffffff81508fb4>] dvb_usb_remote_exit+0x7a/0x90
           [<ffffffff81506157>] dvb_usb_exit+0x1d/0xe5
           [<ffffffff81506e90>] dvb_usb_device_exit+0x69/0x7d
           [<ffffffff8150a181>] pctv452e_usb_disconnect+0x7b/0x80
           [...]
          Object at ffff880033bd9fc0, in cache kmalloc-16 size: 16
          Allocated:
           [...]
          Freed:
          PID = 617
           [...]
           [<ffffffff811f034c>] kfree+0xd9/0x166
           [<ffffffff814fe513>] ir_free_table+0x2f/0x51
           [<ffffffff81500bc1>] rc_unregister_device+0x4d/0xc3
           [<ffffffff81508fb4>] dvb_usb_remote_exit+0x7a/0x90
           [<ffffffff81506157>] dvb_usb_exit+0x1d/0xe5
           [<ffffffff81506e90>] dvb_usb_device_exit+0x69/0x7d
           [<ffffffff8150a181>] pctv452e_usb_disconnect+0x7b/0x80
      
      Another one:
      
          BUG: KASAN: use-after-free in do_sys_poll+0x336/0x6b8 at addr ffff88003563fcc0
          Read of size 8 by task tuner on fronte/1042
          CPU: 1 PID: 1042 Comm: tuner on fronte Tainted: G    B           4.8.0-rc1-hosting+ #60
          Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
           0000000000000000 ffff88003353f910 ffffffff81394e50 ffff88003563fd80
           ffff880035c03200 ffff88003353f938 ffffffff811f271d ffff88003563fc80
           1ffff10006ac7f98 ffffed0006ac7f98 ffff88003353f9b0 ffffffff811f2afe
          Call Trace:
           [...]
           [<ffffffff812289b3>] do_sys_poll+0x336/0x6b8
           [...]
           [<ffffffff81228ed9>] SyS_poll+0xa9/0x194
           [...]
          Object at ffff88003563fc80, in cache kmalloc-256 size: 256
          Allocated:
           [...]
          Freed:
          PID = 617
           [...]
           [<ffffffff811f034c>] kfree+0xd9/0x166
           [<ffffffff814eb60d>] dvb_unregister_device+0xd6/0xe5
           [<ffffffff814fa4ed>] dvb_unregister_frontend+0x4b/0x66
           [<ffffffff8150810b>] dvb_usb_adapter_frontend_exit+0x69/0xac
           [<ffffffff8150617d>] dvb_usb_exit+0x43/0xe5
           [<ffffffff81506e90>] dvb_usb_device_exit+0x69/0x7d
           [<ffffffff8150a181>] pctv452e_usb_disconnect+0x7b/0x80
      Signed-off-by: NMax Kellermann <max.kellermann@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      1f862a68
    • M
      [media] dvb_frontend: add "detach" callback · d812b3ca
      Max Kellermann 提交于
      Prepare for making "release" asynchronous (via kref).  Some operations
      may need to be run synchronously in dvb_frontend_detach(), and that's
      why we need a "detach" callback.
      Signed-off-by: NMax Kellermann <max.kellermann@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      d812b3ca
    • M
      [media] dvb_frontend: merge the two dvb_frontend_detach() versions · 967d8e8f
      Max Kellermann 提交于
      This code duplication is confusing and error prone.  Let's merge them
      by moving the release/dvb_detach call into one function with one
      Signed-off-by: NMax Kellermann <max.kellermann@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      967d8e8f
    • M
      [media] dvb_frontend: tuner_ops.release returns void · 194ced7a
      Max Kellermann 提交于
      It is not clear what this return value means.  All implemenations
      return 0, and the one caller ignores the value.  Let's remove this
      useless return value completely.
      Signed-off-by: NMax Kellermann <max.kellermann@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      194ced7a
    • M
      [media] dvb_frontend: merge duplicate dvb_tuner_ops.release implementations · 22a613e8
      Max Kellermann 提交于
      Most release callback functions are identical: free the "tuner_priv"
      and clear it.  Let's eliminate some bloat by providing this simple
      implementation in the dvb_frontend library.
      Signed-off-by: NMax Kellermann <max.kellermann@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      22a613e8