The order of the pages allocated for the driver buffer must be stored before allocation because it is used in freeing already allocated pages if allocation fails. Signed-off-by: Kai Makisara <kai.makisara@xxxxxxxxxxx> Reported-by: Lukas Kolbe <lkolbe@xxxxxxxxxxxxxxxxxxxxxxxx> --- linux-2.6.37-rc6-git4-1/drivers/scsi/st.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- linux-2.6.37-rc6-git4/drivers/scsi/st.c 2010-12-16 03:24:48.000000000 +0200 +++ linux-2.6.37-rc6-git4-1/drivers/scsi/st.c 2010-12-19 09:42:08.255998445 +0200 @@ -17,7 +17,7 @@ Last modified: 18-JAN-1998 Richard Gooch <rgooch@xxxxxxxxxxxxx> Devfs support */ -static const char *verstr = "20100829"; +static const char *verstr = "20101219"; #include <linux/module.h> @@ -3732,6 +3732,7 @@ static int enlarge_buffer(struct st_buff order < ST_MAX_ORDER && b_size < new_size; order++, b_size *= 2) ; /* empty */ + STbuffer->reserved_page_order = order; } if (max_segs * (PAGE_SIZE << order) < new_size) { if (order == ST_MAX_ORDER) @@ -3758,7 +3759,6 @@ static int enlarge_buffer(struct st_buff segs++; } STbuffer->b_data = page_address(STbuffer->reserved_pages[0]); - STbuffer->reserved_page_order = order; return 1; } -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html