Hello stephen hemminger,
The patch 7ca4593338e1: "netvsc: fix netvsc_set_channels" from Jul
24, 2017, leads to the following static checker warning:
drivers/net/hyperv/netvsc_drv.c:761 netvsc_set_channels()
error: 'nvdev' is not an ERR_PTR
drivers/net/hyperv/netvsc_drv.c:761 netvsc_set_channels()
warn: passing a valid pointer to 'PTR_ERR'
drivers/net/hyperv/netvsc_drv.c
753 memset(&device_info, 0, sizeof(device_info));
754 device_info.num_chn = count;
755 device_info.ring_size = ring_size;
756
757 nvdev = rndis_filter_device_add(dev, &device_info);
758 if (!IS_ERR(nvdev)) {
759 netif_set_real_num_tx_queues(net, nvdev->num_chn);
760 netif_set_real_num_rx_queues(net, nvdev->num_chn);
761 ret = PTR_ERR(nvdev);
^^^^^^^^^^^^^^^^^^^
762 } else {
763 device_info.num_chn = orig;
764 rndis_filter_device_add(dev, &device_info);
Should that be moved here? It's not immediately clear to me what's
happening here.
765 }
766
767 if (was_opened)
768 rndis_filter_open(nvdev);
769
regards,
dan carpenter
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel