]> git.baikalelectronics.ru Git - kernel.git/commit
asix: fix wrong return value in asix_check_host_enable()
authorPavel Skripkin <paskripkin@gmail.com>
Tue, 21 Dec 2021 20:10:43 +0000 (23:10 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 22 Dec 2021 22:52:18 +0000 (14:52 -0800)
commitb9298a8e98f64fe310b543f883825ccb3324f0f9
treed503e4535ff207336db7a223581d707ef8e8f85a
parentee299d5445a386d0a728178ad38303c8d3ecae57
asix: fix wrong return value in asix_check_host_enable()

If asix_read_cmd() returns 0 on 30th interation, 0 will be returned from
asix_check_host_enable(), which is logically wrong. Fix it by returning
-ETIMEDOUT explicitly if we have exceeded 30 iterations

Also, replaced 30 with #define as suggested by Andrew

Fixes: 3966cb1e4eb9 ("net: asix: fix uninit value bugs")
Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/ecd3470ce6c2d5697ac635d0d3b14a47defb4acb.1640117288.git.paskripkin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/asix_common.c