From: Yu Watanabe Date: Sun, 24 Oct 2021 19:37:11 +0000 (+0900) Subject: sd-radv: use assert_return() X-Git-Tag: v250-rc1~412^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=acbb5500e23808f52938baf1c57420f5cf5375c0;p=thirdparty%2Fsystemd.git sd-radv: use assert_return() --- diff --git a/src/libsystemd-network/sd-radv.c b/src/libsystemd-network/sd-radv.c index 2d91a406f83..9030150aeef 100644 --- a/src/libsystemd-network/sd-radv.c +++ b/src/libsystemd-network/sd-radv.c @@ -550,9 +550,7 @@ _public_ int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, int dynamic) { usec_t time_now, valid, preferred, valid_until, preferred_until; assert_return(ra, -EINVAL); - - if (!p) - return -EINVAL; + assert_return(p, -EINVAL); /* Refuse prefixes that don't have a prefix set */ if (in6_addr_is_null(&p->opt.in6_addr)) @@ -666,9 +664,7 @@ _public_ int sd_radv_add_route_prefix(sd_radv *ra, sd_radv_route_prefix *p, int int r; assert_return(ra, -EINVAL); - - if (!p) - return -EINVAL; + assert_return(p, -EINVAL); (void) in_addr_prefix_to_string(AF_INET6, (const union in_addr_union*) &p->opt.in6_addr,