# HG changeset patch # User Josef 'Jeff' Sipek # Date 1614645315 18000 # Node ID 76e588fedba8f0b68e72fe4edd3ab289a1a8b3fe # Parent 1475c860919687e4941597275b6ec2fd468b4aec nvl: make nvpair_value return -ENOENT for NULL pairs This brings it in line with the rest of the nvpair_value_* functions. Signed-off-by: Josef 'Jeff' Sipek diff -r 1475c8609196 -r 76e588fedba8 include/jeffpc/nvl.h --- a/include/jeffpc/nvl.h Mon Feb 22 08:21:03 2021 -0500 +++ b/include/jeffpc/nvl.h Mon Mar 01 19:35:15 2021 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Josef 'Jeff' Sipek + * Copyright (c) 2017-2021 Josef 'Jeff' Sipek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -227,7 +227,7 @@ static inline struct val *nvpair_value(const struct nvpair *pair) { - return val_getref(pair->value); + return pair ? val_getref(pair->value) : ERR_PTR(-ENOENT); } /*