sd-dhcp6-lease: Return only -EINVAL when a NULL lease is supplied
Suppyling a NULL lease is not a condition that needs to be asserted, returning -EINVAL is informative enough to the caller. This simplifies calling code and doesn't falsely indicate that something erroneous was attempted.
This commit is contained in:
committed by
Tom Gundersen
parent
c47e8936a4
commit
fab15fec24
@@ -110,9 +110,11 @@ int dhcp6_lease_set_preference(sd_dhcp6_lease *lease, uint8_t preference) {
|
||||
}
|
||||
|
||||
int dhcp6_lease_get_preference(sd_dhcp6_lease *lease, uint8_t *preference) {
|
||||
assert_return(lease, -EINVAL);
|
||||
assert_return(preference, -EINVAL);
|
||||
|
||||
if (!lease)
|
||||
return -EINVAL;
|
||||
|
||||
*preference = lease->preference;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user