s390/qeth: limit trace to valid data of command request
authorJulian Wiedmann <jwi@linux.ibm.com>
Tue, 12 Feb 2019 17:33:20 +0000 (18:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Feb 2019 18:14:24 +0000 (13:14 -0500)
'len' specifies how much data we send to the HW, don't dump beyond this
boundary.
As of today this is no big concern - commands are built in full, zeroed
pages.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_main.c

index 428175e..ae2ea0a 100644 (file)
@@ -1991,7 +1991,7 @@ void qeth_prepare_control_data(struct qeth_card *card, int len,
        card->seqno.pdu_hdr++;
        memcpy(QETH_PDU_HEADER_ACK_SEQ_NO(iob->data),
               &card->seqno.pdu_hdr_ack, QETH_SEQ_NO_LENGTH);
-       QETH_DBF_HEX(CTRL, 2, iob->data, QETH_DBF_CTRL_LEN);
+       QETH_DBF_HEX(CTRL, 2, iob->data, min(len, QETH_DBF_CTRL_LEN));
 }
 EXPORT_SYMBOL_GPL(qeth_prepare_control_data);