1. 01 11月, 2011 1 次提交
  2. 20 5月, 2011 1 次提交
    • J
      [media] Media, DVB, Siano, smsusb: Avoid static analysis report about 'use after free' · 08921ac9
      Jesper Juhl 提交于
      In drivers/media/dvb/siano/smsusb.c we have this code:
       ...
                     kfree(dev);
      
                     sms_info("device %p destroyed", dev);
       ...
      
      at least one static analysis tool (Coverity Prevent) complains about this
      as a use-after-free bug.
      While it's true that we do use the pointer variable after freeing it, the
      only use is to print the value of the pointer, so there's not actually any
      problem here. But still, silencing the complaint is trivial by just moving
      the kfree() call below the sms_info(), so why not just do it?. It doesn't
      change the workings of the code in any way, but it makes the tool shut up.
      The patch below also removes a rather pointless blank line.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      08921ac9
  3. 29 12月, 2010 1 次提交
  4. 03 8月, 2010 1 次提交
  5. 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
  6. 16 12月, 2009 2 次提交
  7. 07 11月, 2009 1 次提交
  8. 17 6月, 2009 8 次提交
  9. 30 3月, 2009 6 次提交
    • M
      V4L/DVB (10772): siano: prevent duplicate variable declaration · 0d02efe4
      Michael Krufky 提交于
      Fix the following build error:
      
      drivers/media/dvb/siano/smsusb.o: In function `get_order':
      include/asm-generic/page.h:10: multiple definition of `sms_dbg'
      drivers/media/dvb/siano/sms1xxx.o:include/asm-generic/page.h:10: first defined here
      drivers/media/dvb/siano/smsdvb.o: In function `get_order':
      include/asm-generic/page.h:10: multiple definition of `sms_dbg'
      drivers/media/dvb/siano/sms1xxx.o:include/asm-generic/page.h:10: first defined here
      
      Thanks to Mauro Carvalho Chehab for his original patch to address this issue.
      Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      0d02efe4
    • M
      V4L/DVB (10752): sms1xxx: load smsdvb module automatically based on device id · 05860f2d
      Michael Krufky 提交于
      The smsdvb module was separated from the core and usb code. This change loads
      smsdvb automatically for driver configurations that depend on it.
      Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      05860f2d
    • M
      V4L/DVB (10751): sms1xxx: fix checkpatch.pl violations introduced by previous changeset · b9391f41
      Michael Krufky 提交于
      Fix checkpatch.pl violations introduced by previous changeset:
      
      ERROR: do not use C99 // comments
      156: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1373:
      +//#ifdef DVB_CORE
      
      ERROR: do not use C99 // comments
      157: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1374:
      +//	smsdvb_unregister();
      
      ERROR: do not use C99 // comments
      158: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1375:
      +//#endif
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      163: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1380:
      +EXPORT_SYMBOL(smscore_onresponse);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      164: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1381:
      +EXPORT_SYMBOL(sms_get_board);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      165: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1382:
      +EXPORT_SYMBOL(sms_debug);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      166: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1383:
      +EXPORT_SYMBOL(smscore_putbuffer);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      167: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1384:
      +EXPORT_SYMBOL(smscore_registry_getmode);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      168: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1385:
      +EXPORT_SYMBOL(smscore_register_device);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      169: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1386:
      +EXPORT_SYMBOL(smscore_set_board_id);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      170: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1387:
      +EXPORT_SYMBOL(smscore_start_device);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      171: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1388:
      +EXPORT_SYMBOL(smsusb_id_table);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      172: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1389:
      +EXPORT_SYMBOL(smscore_unregister_device);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      173: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1390:
      +EXPORT_SYMBOL(smscore_getbuffer);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      174: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1391:
      +EXPORT_SYMBOL(smscore_get_device_mode);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      175: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1392:
      +EXPORT_SYMBOL(smscore_register_client);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      176: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1393:
      +EXPORT_SYMBOL(smscore_unregister_hotplug);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      177: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1394:
      +EXPORT_SYMBOL(smsclient_sendrequest);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      178: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1395:
      +EXPORT_SYMBOL(smscore_unregister_client);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      179: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1396:
      +EXPORT_SYMBOL(smscore_get_board_id);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      180: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1397:
      +EXPORT_SYMBOL(smscore_register_hotplug);
      
      WARNING: line over 80 characters
      391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398:
      +extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename);
      
      ERROR: "foo* bar" should be "foo *bar"
      391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398:
      +extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename);
      
      WARNING: line over 80 characters
      392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
      +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
      
      ERROR: "foo* bar" should be "foo *bar"
      392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
      +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
      
      ERROR: space required after that ',' (ctx:VxV)
      392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
      +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
                                                                                   ^
      
      WARNING: __func__ should be used instead of gcc specific __FUNCTION__
      489: FILE: linux/drivers/media/dvb/siano/smsusb.c:443:
      +	printk(KERN_INFO"%s  Entering status %d.\n", __FUNCTION__, msg.event);
      
      WARNING: __func__ should be used instead of gcc specific __FUNCTION__
      501: FILE: linux/drivers/media/dvb/siano/smsusb.c:455:
      +	printk(KERN_INFO  "%s  Entering.\n", __FUNCTION__);
      
      ERROR: space prohibited before that '++' (ctx:WxB)
      505: FILE: linux/drivers/media/dvb/siano/smsusb.c:459:
      +	for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i ++)
       	                                                            ^
      
      WARNING: __func__ should be used instead of gcc specific __FUNCTION__
      517: FILE: linux/drivers/media/dvb/siano/smsusb.c:471:
      +			__FUNCTION__, rc);
      Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
      [mchehab@redhat.com: sms_dbg were declared on 3 different files]
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      b9391f41
    • U
      V4L/DVB (10750): import changes from Siano · e0f14c25
      Uri Shkolnik 提交于
      Import the following changes from Uri Shkolnik
      
      * Two-ways merge with Siano internal repository
      * Continuing with DVB sub-system separation
      * kconfig and makefile updates
      * Code cleanup
      
      This is a work-in-progress sync with Siano's internal repository.
      
      Some changes had to be altered or dropped in order not to break the build.
      
      This breaks normal operation for the current driver, but it is being committed
      now for tracking purposes.
      
      These changes introduce the following checkpatch.pl violations:
      
      ERROR: do not use C99 // comments
      156: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1373:
      +//#ifdef DVB_CORE
      
      ERROR: do not use C99 // comments
      157: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1374:
      +//	smsdvb_unregister();
      
      ERROR: do not use C99 // comments
      158: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1375:
      +//#endif
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      163: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1380:
      +EXPORT_SYMBOL(smscore_onresponse);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      164: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1381:
      +EXPORT_SYMBOL(sms_get_board);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      165: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1382:
      +EXPORT_SYMBOL(sms_debug);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      166: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1383:
      +EXPORT_SYMBOL(smscore_putbuffer);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      167: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1384:
      +EXPORT_SYMBOL(smscore_registry_getmode);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      168: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1385:
      +EXPORT_SYMBOL(smscore_register_device);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      169: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1386:
      +EXPORT_SYMBOL(smscore_set_board_id);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      170: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1387:
      +EXPORT_SYMBOL(smscore_start_device);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      171: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1388:
      +EXPORT_SYMBOL(smsusb_id_table);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      172: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1389:
      +EXPORT_SYMBOL(smscore_unregister_device);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      173: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1390:
      +EXPORT_SYMBOL(smscore_getbuffer);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      174: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1391:
      +EXPORT_SYMBOL(smscore_get_device_mode);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      175: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1392:
      +EXPORT_SYMBOL(smscore_register_client);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      176: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1393:
      +EXPORT_SYMBOL(smscore_unregister_hotplug);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      177: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1394:
      +EXPORT_SYMBOL(smsclient_sendrequest);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      178: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1395:
      +EXPORT_SYMBOL(smscore_unregister_client);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      179: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1396:
      +EXPORT_SYMBOL(smscore_get_board_id);
      
      WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      180: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1397:
      +EXPORT_SYMBOL(smscore_register_hotplug);
      
      WARNING: line over 80 characters
      391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398:
      +extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename);
      
      ERROR: "foo* bar" should be "foo *bar"
      391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398:
      +extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename);
      
      WARNING: line over 80 characters
      392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
      +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
      
      ERROR: "foo* bar" should be "foo *bar"
      392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
      +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
      
      ERROR: space required after that ',' (ctx:VxV)
      392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399:
      +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
                                                                                   ^
      
      WARNING: __func__ should be used instead of gcc specific __FUNCTION__
      489: FILE: linux/drivers/media/dvb/siano/smsusb.c:443:
      +	printk(KERN_INFO"%s  Entering status %d.\n", __FUNCTION__, msg.event);
      
      WARNING: __func__ should be used instead of gcc specific __FUNCTION__
      501: FILE: linux/drivers/media/dvb/siano/smsusb.c:455:
      +	printk(KERN_INFO  "%s  Entering.\n", __FUNCTION__);
      
      ERROR: space prohibited before that '++' (ctx:WxB)
      505: FILE: linux/drivers/media/dvb/siano/smsusb.c:459:
      +	for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i ++)
       	                                                            ^
      
      WARNING: __func__ should be used instead of gcc specific __FUNCTION__
      517: FILE: linux/drivers/media/dvb/siano/smsusb.c:471:
      +			__FUNCTION__, rc);
      
      total: 7 errors, 23 warnings, 524 lines checked
      Signed-off-by: NUri Shkolnik <uris@siano-ms.com>
      Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      e0f14c25
    • M
      V4L/DVB (10749): sms1xxx: move smsusb_id_table into smsusb.c · 841a3f0d
      Michael Krufky 提交于
      Move the usb_device_id table to the smsusb module in preparation for the
      sms1xxx module to be split into sub-modules. This will allow the smsusb
      driver to start up automatically upon insertion of the USB device.
      Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      841a3f0d
    • U
      V4L/DVB (10748): sms1xxx: restore smsusb_driver.name to smsusb · dba843af
      Uri Shkolnik 提交于
      The sms1xxx driver will be broken down into smaller modules,
      so the original name, smsusb, is more appropriate.
      Signed-off-by: NUri Shkolnik <uris@siano-ms.com>
      Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      dba843af
  10. 30 12月, 2008 1 次提交
  11. 04 9月, 2008 1 次提交
  12. 20 7月, 2008 16 次提交