Jean Delvare
bbd2d9c919
i2c: Fix userspace_device list corruption
Fix userspace_device list corruption. The corruption was caused by
clients not being removed when adapters with such clients were
themselves removed. Something like the following would trigger it
(assuming i2c-stub gets adapter number 3):
# modprobe i2c-stub chip_addr=0x50
# echo 24c08 0x50 > /sys/bus/i2c/devices/i2c-3/new_device
# rmmod i2c-stub
# modprobe i2c-stub chip_addr=0x50
# echo 24c08 0x50 > /sys/bus/i2c/devices/i2c-3/new_device
For the records, the stack trace in the kernel logs look like this:
kernel: WARNING: at lib/list_debug.c:30 __list_add+0x8b/0x90()
kernel: Hardware name: (...)
kernel: list_add corruption. prev->next should be next (c137fc84), but was (null). (prev=f57111b8).
kernel: Modules linked in: (...)
kernel: Pid: 4669, comm: bash Not tainted 2.6.32-rc8 #259
kernel: Call Trace:
kernel: [<c111eb8b>] ? __list_add+0x8b/0x90
kernel: [<c111eb8b>] ? __list_add+0x8b/0x90
kernel: [<c103265c>] warn_slowpath_common+0x6c/0xc0
kernel: [<c111eb8b>] ? __list_add+0x8b/0x90
kernel: [<c10326f6>] warn_slowpath_fmt+0x26/0x30
kernel: [<c111eb8b>] __list_add+0x8b/0x90
kernel: [<c11ba165>] i2c_sysfs_new_device+0x1c5/0x250
kernel: [<c10861be>] ? might_fault+0x2e/0x80
kernel: [<c11b9fa0>] ? i2c_sysfs_new_device+0x0/0x250
kernel: [<c118c625>] dev_attr_store+0x25/0x30
kernel: [<c10e305c>] sysfs_write_file+0x9c/0xf0
kernel: [<c109d35c>] vfs_write+0x9c/0x160
kernel: [<c10e2fc0>] ? sysfs_write_file+0x0/0xf0
kernel: [<c109d4dd>] sys_write+0x3d/0x70
kernel: [<c1002ed8>] sysenter_do_call+0x12/0x36
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-11-26 09:22:33 +01:00
..
2009-11-06 01:45:11 -05:00
2009-11-03 14:27:06 -05:00
2009-09-30 16:12:20 -07:00
2009-11-03 11:18:18 +01:00
2009-10-29 07:39:27 -07:00
2009-11-14 12:57:08 -08:00
2009-11-19 13:43:06 -08:00
2009-10-06 01:39:51 -07:00
2009-11-17 23:15:04 -05:00
2009-10-29 07:39:31 -07:00
2009-11-04 14:04:06 +01:00
2009-10-14 15:36:19 -07:00
2009-10-05 12:05:40 -07:00
2009-11-12 07:26:00 -08:00
2009-11-17 09:14:49 -08:00
2009-10-13 10:10:33 -07:00
2009-11-16 12:45:40 +01:00
2009-11-26 09:22:33 +01:00
2009-11-09 09:50:55 -08:00
2009-10-11 11:20:58 -07:00
2009-10-11 11:20:58 -07:00
2009-11-16 22:27:12 -08:00
2009-11-18 14:54:45 -08:00
2009-11-16 11:50:42 +00:00
2009-10-11 11:20:58 -07:00
2009-10-14 16:58:35 +11:00
2009-11-13 17:47:00 +11:00
2009-11-07 12:55:15 -02:00
2009-10-11 11:20:58 -07:00
2009-10-27 00:20:33 +01:00
2009-11-05 10:48:30 -08:00
2009-11-12 07:25:57 -08:00
2009-11-16 16:13:35 +00:00
2009-11-18 14:54:45 -08:00
2009-10-15 09:58:27 -06:00
2009-10-09 21:32:05 +02:00
2009-11-19 13:42:02 -08:00
2009-11-03 10:54:58 +01:00
2009-11-03 10:24:19 -05:00
2009-09-25 15:09:48 -04:00
2009-11-12 07:26:01 -08:00
2009-11-16 12:40:25 +00:00
2009-11-16 16:15:49 +00:00
2009-11-13 15:45:03 +01:00
2009-11-11 12:21:06 -05:00
2009-11-12 07:25:57 -08:00
2009-10-03 01:16:12 -04:00
2009-11-17 17:40:32 -08:00
2009-11-10 16:21:12 -05:00
2009-10-30 14:47:44 -07:00
2009-11-05 17:33:24 -05:00
2009-11-13 11:36:00 +09:00
2009-11-18 07:37:51 -08:00
2009-10-11 11:20:58 -07:00
2009-11-17 17:40:33 -08:00
2009-10-29 08:50:37 +10:30
2009-10-04 22:53:41 +02:00
2009-11-10 15:06:52 +00:00
2009-10-04 15:05:10 -07:00