bridge: fix smatch warning / potential null pointer dereference
authorLinus Lüssing <linus.luessing@web.de>
Wed, 11 Jun 2014 23:41:23 +0000 (01:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jun 2014 18:00:24 +0000 (11:00 -0700)
commit6c03ee8bdaa10401f60dee25a719753d2fbbcc36
treed1af9ca21125bb7f52341ea5d379946db1619cfc
parent179584388d7286190dfd9d2a248e25e1ffdfd472
bridge: fix smatch warning / potential null pointer dereference

"New smatch warnings:
  net/bridge/br_multicast.c:1368 br_ip6_multicast_query() error:
    we previously assumed 'group' could be null (see line 1349)"

In the rare (sort of broken) case of a query having a Maximum
Response Delay of zero, we could create a potential null pointer
dereference.

Fixing this by skipping the multicast specific MLD Query parsing again
if no multicast group address is available.

Introduced by dc4eb53a996a78bfb8ea07b47423ff5a3aadc362
("bridge: adhere to querier election mechanism specified by RFCs")

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_multicast.c