projects
/
linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
113ff3a
)
lan78xx: Correctly indicate invalid OTP
author
Phil Elwell
<phil@raspberrypi.org>
Tue, 28 Nov 2017 12:02:37 +0000
(12:02 +0000)
committer
Raspbian kernel package updater
<root@raspbian.org>
Sat, 31 Mar 2018 14:57:25 +0000
(15:57 +0100)
lan78xx_read_otp tries to return -EINVAL in the event of invalid OTP
content, but the value gets overwritten before it is returned and the
read goes ahead anyway. Make the read conditional as it should be
and preserve the error code.
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/net/usb/lan78xx.c
patch
|
blob
|
history
diff --git
a/drivers/net/usb/lan78xx.c
b/drivers/net/usb/lan78xx.c
index aac8f206908797bfdd781ae9b14ba8f03afcb75a..0798b260c38d2ce12ac73dac2ee5a16498c9fc1c 100644
(file)
--- a/
drivers/net/usb/lan78xx.c
+++ b/
drivers/net/usb/lan78xx.c
@@
-874,7
+874,8
@@
static int lan78xx_read_otp(struct lan78xx_net *dev, u32 offset,
offset += 0x100;
else
ret = -EINVAL;
- ret = lan78xx_read_raw_otp(dev, offset, length, data);
+ if (!ret)
+ ret = lan78xx_read_raw_otp(dev, offset, length, data);
}
return ret;