mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Fix coverity defects
Fix coverity defects: coverity scan CID:147623, Type: Resource leak. coverity scan CID:147622, Type: Resource leak. reason: zpool_open zhp, but not zpool_close zhp. so resource leak. coverity scan CID:147621, Type: Resource fd leak. coverity scan CID:147620, Type: Resource fd leak. reason: do_write do_read open file fd,but exception not close fd. delete unuse definition DMU_OS_IS_L2COMPRESSIBLE. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: cao.xuewen <cao.xuewen@zte.com.cn> Closes #5137
This commit is contained in:
@@ -474,6 +474,7 @@ translate_device(const char *pool, const char *device, err_type_t label_type,
|
||||
if (tgt == NULL) {
|
||||
(void) fprintf(stderr, "cannot find device '%s' in "
|
||||
"pool '%s'\n", device, pool);
|
||||
zpool_close(zhp);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -515,5 +516,6 @@ translate_device(const char *pool, const char *device, err_type_t label_type,
|
||||
record->zi_end = record->zi_start + VDEV_PAD_SIZE - 1;
|
||||
break;
|
||||
}
|
||||
zpool_close(zhp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user