Search Linux Wireless

Re: [PATCH] iw: Static analyser fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Amit,

On Tue, Jun 30, 2015 at 10:17 PM, Amit Khatri <amit.khatri@xxxxxxxxxxx> wrote:
> Hi Johannes,
>
> Subject: [PATCH] iw: Static analyser fixes
>
> Signed-off-by: Amit Khatri <amit.khatri@xxxxxxxxxxx>
> Signed-off-by: Rahul Jain <rahul.jain@xxxxxxxxxxx>
> ---
>  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: julian.calaby@xxxxxxxxx
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux