]> git.baikalelectronics.ru Git - kernel.git/commit
uml: fix request->sector update
authorJeff Dike <jdike@addtoit.com>
Mon, 16 Jul 2007 06:38:47 +0000 (23:38 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 16 Jul 2007 16:05:38 +0000 (09:05 -0700)
commit7c9fb919244b92f23b54d8232d88d2c575d4ae91
tree98b0c20ad616258dae150a04307ce3a2ad90adf1
parent1699efd4347f383c6e3a278ecae05810f18d7787
uml: fix request->sector update

It is theoretically possible for a request to finish and be freed between
writing it to the I/O thread and updating the sector count.  In this case, the
update will dereference a freed pointer.

To avoid this, I delay the update until processing the next sg segment, when
the request pointer is known to be good.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/drivers/ubd_kern.c