Hi Johannes,

Subject: [PATCH 3/4] iw: Static analyser report that attr may be NULL so
 either we can remove condition check statement or add goto at end of this
 function.

Signed-off-by: Amit Khatri <[email protected]>
Signed-off-by: Rahul Jain <[email protected]>
---
 event.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 */
 }
 
 static void parse_cqm_event(struct nlattr **attrs)
-- 
1.9.1N�����r��y����b�X��ǧv�^�)޺{.n�+����{��*ޕ�,�{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�m��������zZ+�����ݢj"��!�i

Reply via email to