Hi Matthew, hi list,
the included patch replaces all dangerous memory allocations, at least I hope.
Regards
Oliver
-------------------------------------------------------------
--- linuxvanilla/drivers/usb/storage/datafab.c Mon Sep 10 23:39:59 2001
+++ linux/drivers/usb/storage/datafab.c Mon Sep 17 20:03:28 2001
@@ -208,7 +208,7 @@
if (use_sg) {
sg = (struct scatterlist *) dest;
- buffer = kmalloc(len, GFP_KERNEL);
+ buffer = kmalloc(len, GFP_NOIO);
if (buffer == NULL)
return USB_STOR_TRANSPORT_ERROR;
ptr = buffer;
@@ -333,7 +333,7 @@
if (use_sg) {
sg = (struct scatterlist *) src;
- buffer = kmalloc(len, GFP_KERNEL);
+ buffer = kmalloc(len, GFP_NOIO);
if (buffer == NULL)
return USB_STOR_TRANSPORT_ERROR;
ptr = buffer;
@@ -665,7 +665,7 @@
};
if (!us->extra) {
- us->extra = kmalloc(sizeof(struct datafab_info), GFP_KERNEL);
+ us->extra = kmalloc(sizeof(struct datafab_info), GFP_NOIO);
if (!us->extra) {
US_DEBUGP("datafab_transport: Gah! Can't allocate storage for
Datafab
info struct!\n");
return USB_STOR_TRANSPORT_ERROR;
--- linuxvanilla/drivers/usb/storage/jumpshot.c Mon Sep 10 23:39:59 2001
+++ linux/drivers/usb/storage/jumpshot.c Mon Sep 17 20:06:42 2001
@@ -284,7 +284,7 @@
if (use_sg) {
sg = (struct scatterlist *) dest;
- buffer = kmalloc(len, GFP_KERNEL);
+ buffer = kmalloc(len, GFP_NOIO);
if (buffer == NULL)
return USB_STOR_TRANSPORT_ERROR;
ptr = buffer;
@@ -399,7 +399,7 @@
if (use_sg) {
sg = (struct scatterlist *) src;
- buffer = kmalloc(len, GFP_KERNEL);
+ buffer = kmalloc(len, GFP_NOIO);
if (buffer == NULL)
return USB_STOR_TRANSPORT_ERROR;
ptr = buffer;
@@ -665,7 +665,7 @@
if (!us->extra) {
- us->extra = kmalloc(sizeof(struct jumpshot_info), GFP_KERNEL);
+ us->extra = kmalloc(sizeof(struct jumpshot_info), GFP_NOIO);
if (!us->extra) {
US_DEBUGP("jumpshot_transport: Gah! Can't allocate storage
for jumpshot
info struct!\n");
return USB_STOR_TRANSPORT_ERROR;
--- linuxvanilla/drivers/usb/storage/transport.c Mon Sep 10 23:40:12 2001
+++ linux/drivers/usb/storage/transport.c Mon Sep 17 20:00:55 2001
@@ -388,7 +388,7 @@
devrequest *dr;
/* allocate the device request structure */
- dr = kmalloc(sizeof(devrequest), GFP_KERNEL);
+ dr = kmalloc(sizeof(devrequest), GFP_NOIO);
if (!dr)
return -ENOMEM;
--- linuxvanilla/drivers/usb/storage/sddr09.c Mon Sep 10 23:40:12 2001
+++ linux/drivers/usb/storage/sddr09.c Mon Sep 17 20:13:33 2001
@@ -303,7 +303,7 @@
if (use_sg) {
sg = (struct scatterlist *)content;
- buffer = kmalloc(len, GFP_KERNEL);
+ buffer = kmalloc(len, GFP_NOIO);
if (buffer == NULL)
return USB_STOR_TRANSPORT_ERROR;
ptr = buffer;
@@ -630,16 +630,16 @@
alloc_blocks = (alloc_len + (1<<17) - 1) >> 17;
sg = kmalloc(alloc_blocks*sizeof(struct scatterlist),
- GFP_KERNEL);
+ GFP_NOIO);
if (sg == NULL)
return 0;
for (i=0; i<alloc_blocks; i++) {
if (i<alloc_blocks-1) {
- sg[i].address = kmalloc( (1<<17), GFP_KERNEL );
+ sg[i].address = kmalloc( (1<<17), GFP_NOIO );
sg[i].length = (1<<17);
} else {
- sg[i].address = kmalloc(alloc_len, GFP_KERNEL);
+ sg[i].address = kmalloc(alloc_len, GFP_NOIO);
sg[i].length = alloc_len;
}
alloc_len -= sg[i].length;
@@ -670,8 +670,8 @@
kfree(info->lba_to_pba);
if (info->pba_to_lba)
kfree(info->pba_to_lba);
- info->lba_to_pba = kmalloc(numblocks*sizeof(int), GFP_KERNEL);
- info->pba_to_lba = kmalloc(numblocks*sizeof(int), GFP_KERNEL);
+ info->lba_to_pba = kmalloc(numblocks*sizeof(int), GFP_NOIO);
+ info->pba_to_lba = kmalloc(numblocks*sizeof(int), GFP_NOIO);
if (info->lba_to_pba == NULL || info->pba_to_lba == NULL) {
if (info->lba_to_pba != NULL)
@@ -840,7 +840,7 @@
if (!us->extra) {
us->extra = kmalloc(
- sizeof(struct sddr09_card_info), GFP_KERNEL);
+ sizeof(struct sddr09_card_info), GFP_NOIO);
if (!us->extra)
return USB_STOR_TRANSPORT_ERROR;
memset(us->extra, 0, sizeof(struct sddr09_card_info));
--- linuxvanilla/drivers/usb/storage/shuttle_usbat.c Mon Sep 10 23:39:45 2001
+++ linux/drivers/usb/storage/shuttle_usbat.c Mon Sep 17 20:14:24 2001
@@ -681,7 +681,7 @@
len = (65535/srb->transfersize) * srb->transfersize;
US_DEBUGP("Max read is %d bytes\n", len);
- buffer = kmalloc(len, GFP_KERNEL);
+ buffer = kmalloc(len, GFP_NOIO);
if (buffer == NULL) // bloody hell!
return USB_STOR_TRANSPORT_FAILED;
sector = short_pack(data[7+3], data[7+2]);
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel