igb in linux-3.18.0: some potential bugs
Subsystems (2)
Thank for the reply!
For the first reply:
I let some functions fail on purpose to test error handling code, and then run the driver in reality as well as monitor the function calls in runtime. The results are in my report.
For the second reply:
I admit you are right, and my code style need to be improved.
Quoted 35 lines · Jia-Ju Bai
I have actually tested igb driver on the real hardware(Intel 82575EB PCI-E Gigabit Ethernet Controller), and find some potential bugs:
The target file isdrivers/net/ethernet/intel/igb/igb_main.c(1) In the normal process of igb,
pci_enable_pcie_error_reportingandpci_disable_pcie_error_reportingis called in pairs inigb_probeandigb_remove. However, whenpci_enable_pcie_error_reportinghas been called andalloc_etherdev_mqsinigb_probeis failed, "err_alloc_etherdev"
segment
inigb_probeis executed immediately to exit, butpci_disable_pcie_error_reportingis not called.
(2) The same situation happens whenpci_iomapinigb_probeis failed.
(3) The same situation happens whenigb_sw_initinigb_probeis failed.
(4) The same situation happens whenregister_netdevinigb_probeis failed.
(5) The same situation happens whenigb_init_i2cinigb_probeis failed.(6) The function kcalloc is called by
igb_sw_initwhen initializing the ethernet card driver, but kfree is not called whenregister_netdevinigb_probeis failed, which may cause memory leak.
(7) The same situation happens whenigb_init_i2cinigb_probeis failed.
(8) The same situation happens when kzalloc inigb_alloc_q_vectoris failed.
(9) The same situation happens whenigb_alloc_q_vectorinigb_alloc_q_vectorsis failed.(10) When
igb_init_i2cinigb_probeis failed,igb_enable_sriovis called inigb_probe_vfs, butigb_disable_sriovis not called.
(11) The same situation with [10] happens whenregister_netdevinigb_probeis failed.
Quoted 6 lines
Meanwhile, I also write the patch to fix the bugs. I have run the patch on the hardware, it can work normally and fix the above bugs.
Was this a bug you actually saw? Or a theoretical bug based on code review?
I do not mind adding this to my queue so that we can review and test the patch, although this will cause a fair amount of regression testing.
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
David Miller
maintainerFrom: "Jia-Ju Bai" <[email protected]>
Date: Sat, 20 Dec 2014 20:59:18 +0800
Quoted 1 line
Thank for the reply!
Please do not top-post.
Etiquette on these mailing lists is that you quote a minimal amount of material from the email you are replying to to give enough context to the reader, than you give your response _after_ the quoted material, not before.
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired