Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] st: Store page order before driver buffer allocation

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@kolumbus.fi>
Reported-by: Lukas Kolbe <lkolbe@techfak.uni-bielefeld.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Kai Makisara and committed by
James Bottomley
373daacf a87e3a67

+2 -2
+2 -2
drivers/scsi/st.c
··· 17 17 Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support 18 18 */ 19 19 20 - static const char *verstr = "20100829"; 20 + static const char *verstr = "20101219"; 21 21 22 22 #include <linux/module.h> 23 23 ··· 3732 3732 order < ST_MAX_ORDER && b_size < new_size; 3733 3733 order++, b_size *= 2) 3734 3734 ; /* empty */ 3735 + STbuffer->reserved_page_order = order; 3735 3736 } 3736 3737 if (max_segs * (PAGE_SIZE << order) < new_size) { 3737 3738 if (order == ST_MAX_ORDER) ··· 3759 3758 segs++; 3760 3759 } 3761 3760 STbuffer->b_data = page_address(STbuffer->reserved_pages[0]); 3762 - STbuffer->reserved_page_order = order; 3763 3761 3764 3762 return 1; 3765 3763 }