Subject: Re: [iproute PATCH v2 3/5] tc/q_netem: Don't dereference possibly NULL pointer

From: Stephen Hemminger <[email-masked]>
Date: Fri, 18 Aug 2017 09:25:45 -0700

On Thu, 17 Aug 2017 19:09:29 +0200
Phil Sutter <[email-masked]> wrote:

> @@ -546,6 +546,8 @@ static int netem_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>  	if (opt == NULL)
>  		return 0;
>  
> +	len = RTA_PAYLOAD(opt) - sizeof(qopt);
> +
>  	if (len < 0) {

Dont add blank line between computation and conditional.
Having them together reads better.