Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80597
b: refs/heads/master
c: 3d9dd6e
h: refs/heads/master
i:
  80595: cb90ea5
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Jan 30, 2008
1 parent 48a356c commit f13ece3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b172b6e99e948b6abb180082cfeb8f9b1450ebff
refs/heads/master: 3d9dd6eef888658d26ebea0cc24d15d2a93ab015
18 changes: 17 additions & 1 deletion trunk/drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ int __init scsi_init_queue(void)
0, 0, NULL);
if (!scsi_bidi_sdb_cache) {
printk(KERN_ERR "SCSI: can't init scsi bidi sdb cache\n");
return -ENOMEM;
goto cleanup_io_context;
}

for (i = 0; i < SG_MEMPOOL_NR; i++) {
Expand All @@ -1694,17 +1694,33 @@ int __init scsi_init_queue(void)
if (!sgp->slab) {
printk(KERN_ERR "SCSI: can't init sg slab %s\n",
sgp->name);
goto cleanup_bidi_sdb;
}

sgp->pool = mempool_create_slab_pool(SG_MEMPOOL_SIZE,
sgp->slab);
if (!sgp->pool) {
printk(KERN_ERR "SCSI: can't init sg mempool %s\n",
sgp->name);
goto cleanup_bidi_sdb;
}
}

return 0;

cleanup_bidi_sdb:
for (i = 0; i < SG_MEMPOOL_NR; i++) {
struct scsi_host_sg_pool *sgp = scsi_sg_pools + i;
if (sgp->pool)
mempool_destroy(sgp->pool);
if (sgp->slab)
kmem_cache_destroy(sgp->slab);
}
kmem_cache_destroy(scsi_bidi_sdb_cache);
cleanup_io_context:
kmem_cache_destroy(scsi_io_context_cache);

return -ENOMEM;
}

void scsi_exit_queue(void)
Expand Down

0 comments on commit f13ece3

Please sign in to comment.