The echo field in dln2_transfer_complete comes directly from an USB
transfer and we should not trust it is valid.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
struct dln2_rx_context *rxc;
bool valid_slot = false;
+ if (rx_slot >= DLN2_MAX_RX_SLOTS)
+ goto out;
+
rxc = &rxs->slots[rx_slot];
/*
}
spin_unlock(&rxs->lock);
+out:
if (!valid_slot)
dev_warn(dev, "bad/late response %d/%d\n", handle, rx_slot);