llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)
authorChan Shu Tak, Alex <alexchan@task.com.hk>
Thu, 19 Dec 2019 06:16:18 +0000 (14:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Jan 2020 11:17:23 +0000 (12:17 +0100)
commitfc95d2b0d4ee599147e1897ed6e5168bacb0ada0
tree8b5d1a4ef62b7ef96a93969069a1bfbb09e64d39
parent4b9f0187aa07bd9386cb81e47e0387a6ff679294
llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)

[ Upstream commit af1c0e4e00f3cc76cb136ebf2e2c04e8b6446285 ]

When a frame with NULL DSAP is received, llc_station_rcv is called.
In turn, llc_stat_ev_rx_null_dsap_xid_c is called to check if it is a NULL
XID frame. The return statement of llc_stat_ev_rx_null_dsap_xid_c returns 1
when the incoming frame is not a NULL XID frame and 0 otherwise. Hence, a
NULL XID response is returned unexpectedly, e.g. when the incoming frame is
a NULL TEST command.

To fix the error, simply remove the conditional operator.

A similar error in llc_stat_ev_rx_null_dsap_test_c is also fixed.

Signed-off-by: Chan Shu Tak, Alex <alexchan@task.com.hk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/llc/llc_station.c