[PATCH] USB: SN9C10x driver - bad page state fix
authorDamian Wrobel <dwrobel@ertel.com.pl>
Wed, 23 Nov 2005 23:45:17 +0000 (15:45 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 24 Nov 2005 07:04:27 +0000 (23:04 -0800)
This patch solves the following problem I've already discovered on the
latest 2.6.15-rc1-git1 kernel:

Nov 13 07:37:28 wrobel kernel: Bad page state at free_hot_cold_page (in process 'motion', page c164e020)
Nov 13 07:37:28 wrobel kernel: flags:0x40000400 mapping:00000000 mapcount:0 count:0
Nov 13 07:37:28 wrobel kernel: Backtrace:
Nov 13 07:37:28 wrobel kernel:  [<c0146d86>] bad_page+0x85/0xbe
Nov 13 07:37:28 wrobel kernel:  [<c0147629>] free_hot_cold_page+0x54/0x129
Nov 13 07:37:28 wrobel kernel:  [<c01598c6>] __vunmap+0xa9/0xfe
Nov 13 07:37:28 wrobel kernel:  [<c0154114>] vmalloc_to_page+0x34/0x55
Nov 13 07:37:28 wrobel kernel:  [<c0159942>] vfree+0x27/0x35
Nov 13 07:37:28 wrobel kernel:  [<f8a20292>]  sn9c102_release_buffers+0x30/0x3f [sn9c102]
Nov 13 07:37:28 wrobel kernel:  [<f8a231c2>] sn9c102_release+0x37/0xeb [sn9c102]
Nov 13 07:37:28 wrobel kernel:  [<c0163e74>] __fput+0xa9/0x1aa
Nov 13 07:37:28 wrobel kernel:  [<c01624f7>] filp_close+0x49/0x6d
Nov 13 07:37:30 wrobel kernel:  [<c016258f>] sys_close+0x74/0x95
Nov 13 07:37:30 wrobel kernel:  [<c0102ef9>] syscall_call+0x7/0xb
Nov 13 07:37:31 wrobel kernel: Trying to fix it up, but a reboot is needed

Signed-off-by: Damian Wrobel <dwrobel@ertel.com.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/usb/media/sn9c102_core.c

index cf8cfbabefde8da01e8be66e0fe10434c224f1a7..b2e66e3b90aa4e6453b756affbddd82cb5bbb854 100644 (file)
@@ -199,7 +199,7 @@ static void sn9c102_release_buffers(struct sn9c102_device* cam)
 {
        if (cam->nbuffers) {
                rvfree(cam->frame[0].bufmem,
-                      cam->nbuffers * cam->frame[0].buf.length);
+                      cam->nbuffers * PAGE_ALIGN(cam->frame[0].buf.length));
                cam->nbuffers = 0;
        }
 }