diff options
author | Kai Makisara <Kai.Makisara@kolumbus.fi> | 2010-12-20 17:43:39 +0100 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-23 06:26:50 +0100 |
commit | 373daacfce9ea0091cb3027572354ddebefb8ebb (patch) | |
tree | dcab8e7551cf8c06d688bab74b1e6b8ec7b1b05a /drivers/scsi | |
parent | [SCSI] scsi_debug: set resid to indicate no data-in when medium error (diff) | |
download | linux-373daacfce9ea0091cb3027572354ddebefb8ebb.tar.xz linux-373daacfce9ea0091cb3027572354ddebefb8ebb.zip |
[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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/st.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 5b7388f1c835..12a36acae0b0 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -17,7 +17,7 @@ Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> 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_buffer * STbuffer, int new_size, int need_dm 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_buffer * STbuffer, int new_size, int need_dm segs++; } STbuffer->b_data = page_address(STbuffer->reserved_pages[0]); - STbuffer->reserved_page_order = order; return 1; } |