net: wireless: bcmdhd: Ensure ring memory reading doesn't exceed boundary

There can be cases were the PCIe bus is in invalid state and during this
time all reads will return all ones. During this time the number of items
to be read will be junk value causing read exceeding the boundary.

To avoid this problem, check for improper length and return NULL, so that
caller will not read further.

Bug: 25397008

Change-Id: I6ea2c0c6faa708abe8e167dd899be2427c097d7a
1 file changed