]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hv/netvsc: Fix NULL dereference at single queue mode fallback
authorTakashi Iwai <tiwai@suse.de>
Tue, 14 Aug 2018 17:10:50 +0000 (19:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:37:58 +0000 (08:37 +0200)
commit4b2a6ecd21859d5097af6ef009582c4a416480c5
treecf64691f26e29cea83c5fec80092dc28f710514b
parenteffa7afc5283ecbbdbb4af86eb1be4e710edb136
hv/netvsc: Fix NULL dereference at single queue mode fallback

commit b19b46346f483ae055fa027cb2d5c2ca91484b91 upstream.

The recent commit 916c5e1413be ("hv/netvsc: fix handling of fallback
to single queue mode") tried to fix the fallback behavior to a single
queue mode, but it changed the function to return zero incorrectly,
while the function should return an object pointer.  Eventually this
leads to a NULL dereference at the callers that expect non-NULL
value.

Fix it by returning the proper net_device object.

Fixes: 916c5e1413be ("hv/netvsc: fix handling of fallback to single queue mode")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Alakesh Haloi <alakeshh@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/hyperv/rndis_filter.c