1. 16 Nov, 2010 6 commits
    • Emilio G. Cota's avatar
      staging: vme_user: return the appropriate error code when module_init fails · 55db5020
      Emilio G. Cota authored
      When init_module fails, 0 is returned anyway; the module is then installed
      and oopses when we try to remove it:
      
      [ 3236.368009] WARNING: at drivers/base/driver.c:262 driver_unregister+0x36/0x6f()
      [ 3236.368012] Hardware name:
      [ 3236.368014] Unexpected driver unregister!
      [ 3236.368016] Modules linked in: vme_user(-) vme_tsi148 vme e1000e iTCO_wdt iTCO_vendor_support [last unloaded: vme]
      [ 3236.368027] Pid: 16162, comm: rmmod Not tainted 2.6.35 #2
      [ 3236.368029] Call Trace:
      [ 3236.368037]  [<ffffffff81036ea3>] warn_slowpath_common+0x80/0x98
      [ 3236.368044]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
      [ 3236.368049]  [<ffffffff81036f4f>] warn_slowpath_fmt+0x41/0x43
      [ 3236.368054]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
      [ 3236.368059]  [<ffffffff811e8f78>] driver_unregister+0x36/0x6f
      [ 3236.368066]  [<ffffffffa004aa44>] vme_unregister_driver+0xd/0xf [vme]
      [ 3236.368072]  [<ffffffffa00616c8>] vme_user_exit+0x10/0x1e [vme_user]
      [ 3236.368076]  [<ffffffff810612c1>] sys_delete_module+0x1ba/0x226
      [ 3236.368082]  [<ffffffff812d6e14>] ? do_page_fault+0x25d/0x28a
      [ 3236.368088]  [<ffffffff8100202b>] system_call_fastpath+0x16/0x1b
      [ 3236.368092] ---[ end trace cab6d88ebc44c1de ]---
      
      The appended fixes it by returning the appropriate error code in module_init
      whenever something goes wrong, thus cancelling the insertion of the module.
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Acked-by: default avatarMartyn Welch <martyn.welch@ge.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      55db5020
    • Emilio G. Cota's avatar
      staging: vme: style: convert '&(foo)' to '&foo' · 886953e9
      Emilio G. Cota authored
      done with
      find . -name '*.c' | xargs perl -p -i -e 's/&\(([^()]+)\)/&$1/g'
      Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
      Acked-by: default avatarMartyn Welch <martyn.welch@ge.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      886953e9
    • Steven Rostedt's avatar
      staging: ft1000: Copy from user into correct data · 7f55f13c
      Steven Rostedt authored
      While doing a ktest.pl I used a MIN_CONFIG that had STAGING enabled, and
      a randconfig with CONFIG_DEBUG_STRICT_USER_COPY_CHECKS enabled caught
      the following bug:
      
      In file included from /home/rostedt/work/autotest/nobackup/linux-test.git/arch/x86/include/asm/uaccess.h:571:0,
                       from /home/rostedt/work/autotest/nobackup/linux-test.git/include/linux/poll.h:14,
                       from /home/rostedt/work/autotest/nobackup/linux-test.git/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c:32:
      In function 'copy_from_user',
          inlined from 'ft1000_ChIoctl' at /home/rostedt/work/autotest/nobackup/linux-test.git/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c:702:36:
      /home/rostedt/work/autotest/nobackup/linux-test.git/arch/x86/include/asm/uaccess_32.h:212:26: error: call to 'copy_from_user_overflow' declared with attribute error: copy_from_user() buffer size is not provably correct
      
      Looking at the code it was obvious what the problem was. The pointer
      dpram_data was being allocated but the address was being written to.
      Looking at the comment above the code shows that it use to write into an
      element of that pointer where the '&' is appropriate. But now that it
      writes to the pointer itself, we need to remove the '&' otherwise we
      write over the pointer and not into the data it points to.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Marek Belisko <marek.belisko@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7f55f13c
    • Marek Belisko's avatar
      staging: ft1000: Fix error goto statements. · e72115bc
      Marek Belisko authored
      With commit 2dab1ac8 there
      was intruduced error which lead to stopping uninitialized
      kthread which leads to kernel panics.
      
      This patch fix problems with common entry point in correct
      way.
      Signed-off-by: default avatarMarek Belisko <marek.belisko@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e72115bc
    • Greg Kroah-Hartman's avatar
      Staging: Merge 2.6.37-rc2 into staging-next · 491acf00
      Greg Kroah-Hartman authored
      This was necessary in order  to resolve some conflicts that happened
      between -rc1 and -rc2 with the following files:
      	drivers/staging/bcm/Bcmchar.c
      	drivers/staging/intel_sst/intel_sst_app_interface.c
      
      All should be resolved now.
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      491acf00
    • Linus Torvalds's avatar
      Linux 2.6.37-rc2 · e53beacd
      Linus Torvalds authored
      e53beacd
  2. 15 Nov, 2010 33 commits
  3. 14 Nov, 2010 1 commit