Skip to content

Commit 80343c2

Browse files
tiwaimerwick
authored andcommitted
hv/netvsc: Fix NULL dereference at single queue mode fallback
The recent commit 916c5e1 ("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: 916c5e1 ("hv/netvsc: fix handling of fallback to single queue mode") Signed-off-by: Takashi Iwai <[email protected]> Reviewed-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit b19b463) Orabug: 28671425 Signed-off-by: Liam Merwick <[email protected]> Reviewed-by: Darren Kenny <[email protected]> Reviewed-by: Alejandro Jimenez <[email protected]> Tested-by: Vijay Balakrishna <[email protected]>
1 parent ffec1cc commit 80343c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/hyperv/rndis_filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
13381338
/* setting up multiple channels failed */
13391339
net_device->max_chn = 1;
13401340
net_device->num_chn = 1;
1341-
return 0;
1341+
return net_device;
13421342

13431343
err_dev_remv:
13441344
rndis_filter_device_remove(dev, net_device);

0 commit comments

Comments
 (0)