summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIntiyaz Basha <intiyaz.basha@cavium.com>2018-03-08 07:12:24 +0100
committerDavid S. Miller <davem@davemloft.net>2018-03-09 03:45:46 +0100
commitfcbedd0f29692c0aea3a32d41c8739de7420f140 (patch)
tree271109caa0c0032577ccb67e636d2959dc4370b6
parentMerge tag 'mlx5-updates-2018-02-28-2' of git://git.kernel.org/pub/scm/linux/k... (diff)
downloadlinux-fcbedd0f29692c0aea3a32d41c8739de7420f140.tar.xz
linux-fcbedd0f29692c0aea3a32d41c8739de7420f140.zip
liquidio: Resolved mbox read issue while reading more than one 64bit data
Corrected length check when data received in the mbox is more than one 64 bit data value Signed-off-by: Intiyaz Basha <intiyaz.basha@cavium.com> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c b/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c
index 57af7df74ced..28e74ee23ff8 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c
@@ -87,7 +87,7 @@ int octeon_mbox_read(struct octeon_mbox *mbox)
}
if (mbox->state & OCTEON_MBOX_STATE_REQUEST_RECEIVING) {
- if (mbox->mbox_req.recv_len < msg.s.len) {
+ if (mbox->mbox_req.recv_len < mbox->mbox_req.msg.s.len) {
ret = 0;
} else {
mbox->state &= ~OCTEON_MBOX_STATE_REQUEST_RECEIVING;
@@ -96,7 +96,8 @@ int octeon_mbox_read(struct octeon_mbox *mbox)
}
} else {
if (mbox->state & OCTEON_MBOX_STATE_RESPONSE_RECEIVING) {
- if (mbox->mbox_resp.recv_len < msg.s.len) {
+ if (mbox->mbox_resp.recv_len <
+ mbox->mbox_resp.msg.s.len) {
ret = 0;
} else {
mbox->state &=