diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 13:09:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 13:09:16 -0400 |
commit | 92d15c2ccbb3e31a3fc71ad28fdb55e1319383c0 (patch) | |
tree | 8d83c0dc3c6b935d8367e331872f242b742f0a8a /drivers/usb/storage/sddr55.c | |
parent | f20bf6125605acbbc7eb8c9420d7221c91aa83eb (diff) | |
parent | 644bd2f048972d75eb1979b1fdca257d528ce687 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block: (63 commits)
Fix memory leak in dm-crypt
SPARC64: sg chaining support
SPARC: sg chaining support
PPC: sg chaining support
PS3: sg chaining support
IA64: sg chaining support
x86-64: enable sg chaining
x86-64: update pci-gart iommu to sg helpers
x86-64: update nommu to sg helpers
x86-64: update calgary iommu to sg helpers
swiotlb: sg chaining support
i386: enable sg chaining
i386 dma_map_sg: convert to using sg helpers
mmc: need to zero sglist on init
Panic in blk_rq_map_sg() from CCISS driver
remove sglist_len
remove blk_queue_max_phys_segments in libata
revert sg segment size ifdefs
Fixup u14-34f ENABLE_SG_CHAINING
qla1280: enable use_sg_chaining option
...
Diffstat (limited to 'drivers/usb/storage/sddr55.c')
-rw-r--r-- | drivers/usb/storage/sddr55.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c index 0b1b5b59ca7b..d43a3415e12f 100644 --- a/drivers/usb/storage/sddr55.c +++ b/drivers/usb/storage/sddr55.c | |||
@@ -167,7 +167,8 @@ static int sddr55_read_data(struct us_data *us, | |||
167 | unsigned long address; | 167 | unsigned long address; |
168 | 168 | ||
169 | unsigned short pages; | 169 | unsigned short pages; |
170 | unsigned int len, index, offset; | 170 | unsigned int len, offset; |
171 | struct scatterlist *sg; | ||
171 | 172 | ||
172 | // Since we only read in one block at a time, we have to create | 173 | // Since we only read in one block at a time, we have to create |
173 | // a bounce buffer and move the data a piece at a time between the | 174 | // a bounce buffer and move the data a piece at a time between the |
@@ -178,7 +179,8 @@ static int sddr55_read_data(struct us_data *us, | |||
178 | buffer = kmalloc(len, GFP_NOIO); | 179 | buffer = kmalloc(len, GFP_NOIO); |
179 | if (buffer == NULL) | 180 | if (buffer == NULL) |
180 | return USB_STOR_TRANSPORT_ERROR; /* out of memory */ | 181 | return USB_STOR_TRANSPORT_ERROR; /* out of memory */ |
181 | index = offset = 0; | 182 | offset = 0; |
183 | sg = NULL; | ||
182 | 184 | ||
183 | while (sectors>0) { | 185 | while (sectors>0) { |
184 | 186 | ||
@@ -255,7 +257,7 @@ static int sddr55_read_data(struct us_data *us, | |||
255 | 257 | ||
256 | // Store the data in the transfer buffer | 258 | // Store the data in the transfer buffer |
257 | usb_stor_access_xfer_buf(buffer, len, us->srb, | 259 | usb_stor_access_xfer_buf(buffer, len, us->srb, |
258 | &index, &offset, TO_XFER_BUF); | 260 | &sg, &offset, TO_XFER_BUF); |
259 | 261 | ||
260 | page = 0; | 262 | page = 0; |
261 | lba++; | 263 | lba++; |
@@ -287,7 +289,8 @@ static int sddr55_write_data(struct us_data *us, | |||
287 | 289 | ||
288 | unsigned short pages; | 290 | unsigned short pages; |
289 | int i; | 291 | int i; |
290 | unsigned int len, index, offset; | 292 | unsigned int len, offset; |
293 | struct scatterlist *sg; | ||
291 | 294 | ||
292 | /* check if we are allowed to write */ | 295 | /* check if we are allowed to write */ |
293 | if (info->read_only || info->force_read_only) { | 296 | if (info->read_only || info->force_read_only) { |
@@ -304,7 +307,8 @@ static int sddr55_write_data(struct us_data *us, | |||
304 | buffer = kmalloc(len, GFP_NOIO); | 307 | buffer = kmalloc(len, GFP_NOIO); |
305 | if (buffer == NULL) | 308 | if (buffer == NULL) |
306 | return USB_STOR_TRANSPORT_ERROR; | 309 | return USB_STOR_TRANSPORT_ERROR; |
307 | index = offset = 0; | 310 | offset = 0; |
311 | sg = NULL; | ||
308 | 312 | ||
309 | while (sectors > 0) { | 313 | while (sectors > 0) { |
310 | 314 | ||
@@ -322,7 +326,7 @@ static int sddr55_write_data(struct us_data *us, | |||
322 | 326 | ||
323 | // Get the data from the transfer buffer | 327 | // Get the data from the transfer buffer |
324 | usb_stor_access_xfer_buf(buffer, len, us->srb, | 328 | usb_stor_access_xfer_buf(buffer, len, us->srb, |
325 | &index, &offset, FROM_XFER_BUF); | 329 | &sg, &offset, FROM_XFER_BUF); |
326 | 330 | ||
327 | US_DEBUGP("Write %02X pages, to PBA %04X" | 331 | US_DEBUGP("Write %02X pages, to PBA %04X" |
328 | " (LBA %04X) page %02X\n", | 332 | " (LBA %04X) page %02X\n", |