1. 15 Aug, 2007 7 commits
    • Herbert Xu's avatar
      [NET]: Fix unbalanced rcu_read_unlock in __sock_create · 3b185525
      Herbert Xu authored
      The recent RCU work created an unbalanced rcu_read_unlock
      in __sock_create.  This patch fixes that.  Reported by
      oleg 123.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b185525
    • David S. Miller's avatar
    • Adrian Bunk's avatar
      [VLAN] net/8021q/vlanproc.c: fix check-after-use · 16f3051b
      Adrian Bunk authored
      The Coverity checker spotted that we'd have already oops'ed if
      "vlandev" was NULL.
      Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16f3051b
    • Adrian Bunk's avatar
      [NET]: Unexport dev_ethtool · 6f93b9c2
      Adrian Bunk authored
      This patch removes the no longer used EXPORT_SYMBOL(dev_ethtool).
      Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
      Acked-by: default avatarMatthew Wilcox <matthew@wil.cx>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f93b9c2
    • Shannon Nelson's avatar
      [IOAT]: Remove redundant struct member to avoid descriptor cache miss · 54a09feb
      Shannon Nelson authored
      The layout for struct ioat_desc_sw is non-optimal and causes an extra
      cache hit for every descriptor processed.  By tightening up the struct
      layout and removing one item, we pull in the fields that get used in
      the speedpath and get a little better performance.
      
      
      Before:
      -------
      struct ioat_desc_sw {
      	struct ioat_dma_descriptor * hw;                 /*     0     8
      */
      	struct list_head           node;                 /*     8    16
      */
      	int                        tx_cnt;               /*    24     4
      */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	dma_addr_t                 src;                  /*    32     8
      */
      	__u32                      src_len;              /*    40     4
      */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	dma_addr_t                 dst;                  /*    48     8
      */
      	__u32                      dst_len;              /*    56     4
      */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	struct dma_async_tx_descriptor async_tx;         /*    64   144
      */
      	/* --- cacheline 3 boundary (192 bytes) was 16 bytes ago --- */
      
      	/* size: 208, cachelines: 4 */
      	/* sum members: 196, holes: 3, sum holes: 12 */
      	/* last cacheline: 16 bytes */
      };	/* definitions: 1 */
      
      
      After:
      ------
      
      struct ioat_desc_sw {
      	struct ioat_dma_descriptor * hw;                 /*     0     8
      */
      	struct list_head           node;                 /*     8    16
      */
      	int                        tx_cnt;               /*    24     4
      */
      	__u32                      len;                  /*    28     4
      */
      	dma_addr_t                 src;                  /*    32     8
      */
      	dma_addr_t                 dst;                  /*    40     8
      */
      	struct dma_async_tx_descriptor async_tx;         /*    48   144
      */
      	/* --- cacheline 3 boundary (192 bytes) --- */
      
      	/* size: 192, cachelines: 3 */
      };	/* definitions: 1 */
      Signed-off-by: default avatarShannon Nelson <shannon.nelson@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54a09feb
    • Alexey Dobriyan's avatar
      [ECONET]: remove econet_packet_type on unload · 9c29a377
      Alexey Dobriyan authored
      Steps to reproduce:
      
      	modprobe econet
      	rmmod econet
      	modprobe econet
      
      Unable to handle kernel paging request at ffffffff8870a098 RIP: 
       [<ffffffff8040bfb8>] dev_add_pack+0x48/0x90
      PGD 203067 PUD 207063 PMD 7817f067 PTE 0
      Oops: 0002 [1] PREEMPT SMP 
      CPU 1 
      Modules linked in: econet [maaaany]
      Pid: 10671, comm: modprobe Not tainted 2.6.23-rc3-bloat #6
      RIP: 0010:[<ffffffff8040bfb8>]  [<ffffffff8040bfb8>] dev_add_pack+0x48/0x90
      RSP: 0000:ffff810076293df8  EFLAGS: 00010202
      RAX: ffffffff88659090 RBX: ffffffff88659060 RCX: ffffffff8870a090
      RDX: 0000000000000080 RSI: ffffffff805ec660 RDI: ffff810078ce4680
      RBP: ffff810076293e08 R08: 0000000000000002 R09: 0000000000000000
      R10: ffffffff8040bf88 R11: 0000000000000001 R12: ffff810076293e18
      R13: 000000000000001b R14: ffff810076dd06b0 R15: ffffffff886590c0
      FS:  00002b96a525dae0(0000) GS:ffff81007e0e2138(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: ffffffff8870a098 CR3: 000000007bb67000 CR4: 00000000000026e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process modprobe (pid: 10671, threadinfo ffff810076292000, task ffff810078ce4680)
      Stack:  ffff810076dd06b0 0000000000000000 ffff810076293e38 ffffffff8865b180
       0000000000800000 0000000000000000 ffffffff886590c0 ffff810076dd01c8
       ffff810076293f78 ffffffff8026723c ffff810076293e48 ffffffff886590d8
      Call Trace:
       [<ffffffff8865b180>] :econet:econet_proto_init+0x180/0x1da
       [<ffffffff8026723c>] sys_init_module+0x15c/0x19e0
       [<ffffffff8020c13e>] system_call+0x7e/0x83
      
      
      Code: 48 89 41 08 48 89 82 e0 c5 5e 80 48 c7 c7 a0 08 5d 80 e8 f1 
      RIP  [<ffffffff8040bfb8>] dev_add_pack+0x48/0x90
       RSP <ffff810076293df8>
      CR2: ffffffff8870a098
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c29a377
    • Alexey Dobriyan's avatar
      [AX25]: don't free pointers to statically allocated data · 9ac0be9d
      Alexey Dobriyan authored
      commit 8d5cf596 started to add statically
      allocated ax25_protocol's to list. However kfree() was still in place waiting
      for unsuspecting ones on module removal.
      
      Steps to reproduce:
      
      	modprobe netrom
      	rmmod netrom
      
      P.S.: code would benefit greatly from list_add/list_del usage
      
      kernel BUG at mm/slab.c:592!
      invalid opcode: 0000 [1] PREEMPT SMP 
      CPU 0 
      Modules linked in: netrom ax25 af_packet usbcore rtc_cmos rtc_core rtc_lib
      Pid: 4477, comm: rmmod Not tainted 2.6.23-rc3-bloat #2
      RIP: 0010:[<ffffffff802ac646>]  [<ffffffff802ac646>] kfree+0x1c6/0x260
      RSP: 0000:ffff810079a05e48  EFLAGS: 00010046
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff81000000c000
      RDX: ffff81007e552458 RSI: 0000000000000000 RDI: 000000000000805d
      RBP: ffff810079a05e88 R08: 0000000000000001 R09: 0000000000000000
      R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff8805d080
      R13: ffffffff8805d080 R14: 0000000000000000 R15: 0000000000000282
      FS:  00002b73fc98aae0(0000) GS:ffffffff805dc000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 000000000053f3b8 CR3: 0000000079ff2000 CR4: 00000000000006e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process rmmod (pid: 4477, threadinfo ffff810079a04000, task ffff8100775aa480)
      Stack:  ffff810079a05e68 0000000000000246 ffffffff8804eca0 0000000000000000
       ffffffff8805d080 00000000000000cf 0000000000000000 0000000000000880
       ffff810079a05eb8 ffffffff8803ec90 ffff810079a05eb8 0000000000000000
      Call Trace:
       [<ffffffff8803ec90>] :ax25:ax25_protocol_release+0xa0/0xb0
       [<ffffffff88056ecb>] :netrom:nr_exit+0x6b/0xf0
       [<ffffffff80268bf0>] sys_delete_module+0x170/0x1f0
       [<ffffffff8025da35>] trace_hardirqs_on+0xd5/0x170
       [<ffffffff804835aa>] trace_hardirqs_on_thunk+0x35/0x37
       [<ffffffff8020c13e>] system_call+0x7e/0x83
      
      
      Code: 0f 0b eb fe 66 66 90 66 66 90 48 8b 52 10 48 8b 02 25 00 40 
      RIP  [<ffffffff802ac646>] kfree+0x1c6/0x260
       RSP <ffff810079a05e48>
      Kernel panic - not syncing: Fatal exception
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9ac0be9d
  2. 14 Aug, 2007 33 commits