mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
kmem_zalloc(..., KM_SLEEP) will never fail
By definitition these allocations will never fail. For consistency with the rest of the code remove this dead error handling code. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1558
This commit is contained in:
parent
ab68b6e5db
commit
0a6bef26ec
@ -5136,8 +5136,6 @@ zfsdev_state_init(struct file *filp)
|
|||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
|
|
||||||
zs = kmem_zalloc( sizeof(zfsdev_state_t), KM_SLEEP);
|
zs = kmem_zalloc( sizeof(zfsdev_state_t), KM_SLEEP);
|
||||||
if (zs == NULL)
|
|
||||||
return (ENOMEM);
|
|
||||||
|
|
||||||
zs->zs_file = filp;
|
zs->zs_file = filp;
|
||||||
zs->zs_minor = minor;
|
zs->zs_minor = minor;
|
||||||
|
@ -1214,8 +1214,6 @@ zvol_alloc(dev_t dev, const char *name)
|
|||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
zv = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP);
|
zv = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP);
|
||||||
if (zv == NULL)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
zv->zv_queue = blk_init_queue(zvol_request, &zv->zv_lock);
|
zv->zv_queue = blk_init_queue(zvol_request, &zv->zv_lock);
|
||||||
if (zv->zv_queue == NULL)
|
if (zv->zv_queue == NULL)
|
||||||
@ -1267,7 +1265,7 @@ out_queue:
|
|||||||
blk_cleanup_queue(zv->zv_queue);
|
blk_cleanup_queue(zv->zv_queue);
|
||||||
out_kmem:
|
out_kmem:
|
||||||
kmem_free(zv, sizeof (zvol_state_t));
|
kmem_free(zv, sizeof (zvol_state_t));
|
||||||
out:
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user