Skip to content
Commit 920a9fa2 authored by Pavel Skripkin's avatar Pavel Skripkin Committed by David S. Miller
Browse files

net: asix: add proper error handling of usb read errors



Syzbot once again hit uninit value in asix driver. The problem still the
same -- asix_read_cmd() reads less bytes, than was requested by caller.

Since all read requests are performed via asix_read_cmd() let's catch
usb related error there and add __must_check notation to be sure all
callers actually check return value.

So, this patch adds sanity check inside asix_read_cmd(), that simply
checks if bytes read are not less, than was requested and adds missing
error handling of asix_read_cmd() all across the driver code.

Fixes: d9fe64e5 ("net: asix: Add in_pm parameter")
Reported-and-tested-by: default avatar <syzbot+6ca9f7867b77c2d316ac@syzkaller.appspotmail.com>
Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Tested-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b845bac8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment