Prashant Malani f53a7ad189 r8152: Set memory to all 0xFFs on failed reg reads
get_registers() blindly copies the memory written to by the
usb_control_msg() call even if the underlying urb failed.

This could lead to junk register values being read by the driver, since
some indirect callers of get_registers() ignore the return values. One
example is:
  ocp_read_dword() ignores the return value of generic_ocp_read(), which
  calls get_registers().

So, emulate PCI "Master Abort" behavior by setting the buffer to all
0xFFs when usb_control_msg() fails.

This patch is copied from the r8152 driver (v2.12.0) published by
Realtek (www.realtek.com).

Signed-off-by: Prashant Malani <pmalani@chromium.org>
Acked-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-08-25 19:52:59 -07:00
..
2019-08-16 12:35:56 +02:00
2019-08-12 08:18:37 -06:00
2019-07-19 17:13:56 -07:00
2019-07-18 09:49:30 +02:00
2019-08-07 14:50:49 -07:00
2019-08-18 09:26:16 -07:00
2019-08-14 10:31:11 -07:00
2019-08-01 20:21:00 +02:00
2019-07-09 08:59:39 -07:00
2019-08-09 09:28:18 -07:00
2019-08-16 08:59:33 -07:00
2019-07-20 09:34:55 -07:00
2019-07-11 18:11:21 -07:00
2019-07-11 15:14:01 -07:00
2019-07-27 08:25:51 -07:00
2019-08-17 19:39:54 -07:00
2019-07-15 20:44:49 -07:00
2019-08-12 10:47:55 +02:00
2019-07-01 15:04:59 +02:00
2019-07-17 11:44:41 -07:00
2019-07-19 17:13:56 -07:00
2019-07-17 10:03:50 -07:00
2019-08-13 10:31:31 -07:00
2019-08-05 11:49:02 -07:00
2019-08-17 17:09:33 +02:00
2019-07-17 11:23:13 -07:00
2019-08-02 15:26:48 -07:00