diff options
author | mwleeds@mailtundra.com <mwleeds@mailtundra.com> | 2024-04-06 18:47:25 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-04-17 10:08:48 -0600 |
commit | 0c17f85710a70a24ec19852a2f6f0749e807656f (patch) | |
tree | 3a34fafe62c03a2ae0f9af2a631855cae513992d | |
parent | 9cba29b19f43f9450117e8bc89e7dda691ed5ab5 (diff) |
zfs: Fix malloc() success check
This code was hitting the error code path whenever malloc() succeeded
rather than when it failed, so presumably this part of the code hasn't
been tested. I had to apply this fix (and others) to get U-Boot to boot
from ZFS on an Nvidia Jetson TX2 NX SoM (an aarch64 computer).
Signed-off-by: Phaedrus Leeds <mwleeds@mailtundra.com>
-rw-r--r-- | fs/zfs/zfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c index 1fec96cd5ce..14779dee32d 100644 --- a/fs/zfs/zfs.c +++ b/fs/zfs/zfs.c @@ -655,7 +655,7 @@ dmu_read(dnode_end_t *dn, uint64_t blkid, void **buf, dn->endian) << SPA_MINBLOCKSHIFT; *buf = malloc(size); - if (*buf) { + if (!*buf) { err = ZFS_ERR_OUT_OF_MEMORY; break; } |