]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Dec 2019 05:19:36 +0000 (21:19 -0800)
commite94d6a8e14635d258870ff9b0d2d0983a9c4cf65
tree813b496e56a412f0dfaf103b279709da5f149eef
parent43dcd88433ef72aca211a480686aff1dbd9df25b
llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)

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>
net/llc/llc_station.c