zpool_history_unpack: return correct errno on nvlist_unpack failure
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com> Signed-off-by: WHR <msl0000023508@gmail.com> Closes #13321
This commit is contained in:
parent
9b80d9e6f9
commit
115a92ca6a
|
@ -120,8 +120,9 @@ zpool_history_unpack(char *buf, uint64_t bytes_read, uint64_t *leftover,
|
|||
break;
|
||||
|
||||
/* unpack record */
|
||||
if (nvlist_unpack(buf + sizeof (reclen), reclen, &nv, 0) != 0)
|
||||
return (ENOMEM);
|
||||
int err = nvlist_unpack(buf + sizeof (reclen), reclen, &nv, 0);
|
||||
if (err != 0)
|
||||
return (err);
|
||||
bytes_read -= sizeof (reclen) + reclen;
|
||||
buf += sizeof (reclen) + reclen;
|
||||
|
||||
|
|
Loading…
Reference in New Issue