Hi Amit,

On Tue, Jun 30, 2015 at 10:17 PM, Amit Khatri <[email protected]> wrote:
> Hi Johannes,
>
> Subject: [PATCH] iw: Static analyser fixes
>
> Signed-off-by: Amit Khatri <[email protected]>
> Signed-off-by: Rahul Jain <[email protected]>
> ---
>  cqm.c   | 2 ++
>  event.c | 6 +++++-
>  iw.c    | 2 +-
>  scan.c  | 2 ++
>  4 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/event.c b/event.c
> index f73e078..06d236b 100644
> --- a/event.c
> +++ b/event.c
> @@ -49,8 +49,10 @@ static void print_frame(struct print_event_args *args, 
> struct nlattr *attr)
>         char macbuf[6*3];
>         uint16_t tmp;
>
> -       if (!attr)
> +       if (!attr) {
>                 printf(" [no frame]");
> +               goto out;
> +       }
>
>         frame = nla_data(attr);
>         len = nla_len(attr);
> @@ -97,6 +99,8 @@ static void print_frame(struct print_event_args *args, 
> struct nlattr *attr)
>         for (i = 0; i < len; i++)
>                 printf(" %.02x", frame[i]);
>         printf("]");
> + out:
> +       ;  /*empty statement to avoid compiler error */

Er, why not just return in the if (!attr) block?

Thanks,

-- 
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to