Patch "llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)" has been added to the 4.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     llc2-fix-return-statement-of-llc_stat_ev_rx_null_dsa.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ae512cadc1be4056f9cd27e1b2fea81e3ef1df96
Author: Chan Shu Tak, Alex <alexchan@xxxxxxxxxxx>
Date:   Thu Dec 19 14:16:18 2019 +0800

    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@xxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c
index 204a8351efff..c29170e767a8 100644
--- a/net/llc/llc_station.c
+++ b/net/llc/llc_station.c
@@ -32,7 +32,7 @@ static int llc_stat_ev_rx_null_dsap_xid_c(struct sk_buff *skb)
 	return LLC_PDU_IS_CMD(pdu) &&			/* command PDU */
 	       LLC_PDU_TYPE_IS_U(pdu) &&		/* U type PDU */
 	       LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_XID &&
-	       !pdu->dsap ? 0 : 1;			/* NULL DSAP value */
+	       !pdu->dsap;				/* NULL DSAP value */
 }
 
 static int llc_stat_ev_rx_null_dsap_test_c(struct sk_buff *skb)
@@ -42,7 +42,7 @@ static int llc_stat_ev_rx_null_dsap_test_c(struct sk_buff *skb)
 	return LLC_PDU_IS_CMD(pdu) &&			/* command PDU */
 	       LLC_PDU_TYPE_IS_U(pdu) &&		/* U type PDU */
 	       LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_TEST &&
-	       !pdu->dsap ? 0 : 1;			/* NULL DSAP */
+	       !pdu->dsap;				/* NULL DSAP */
 }
 
 static int llc_station_ac_send_xid_r(struct sk_buff *skb)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux