Re: [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.
On Fri, 2015-06-26 at 09:12 +, Amit Khatri wrote: 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. That's far far too much for the subject. Please submit properly formatted patches with a single-line subject and a more detailed description in the body. + out: + ; /*empty statement to avoid compiler error */ } Just doing return; instead of goto out; would seem more reasonable than all these contortions? johannes -- To unsubscribe from this list: send the line unsubscribe linux-wireless in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[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.
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 amit.kha...@samsung.com Signed-off-by: Rahul Jain rahul.j...@samsung.com --- 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��yb�X��ǧv�^�){.n�+{��*ޕ�,�{ay�ʇڙ�,j��f���h���z��w��� ���j:+v���w�j�mzZ+�ݢj��!�i