Thread (3 messages) flat view 3 messages, 3 authors, 2021-10-18

Re: [PATCH] mISDN: Fix return values of the probe function

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-10-18 23:15:37
Also in: lkml

On Mon, 18 Oct 2021 20:06:51 +0300 Denis Kirjanov wrote:
10/18/21 5:20 PM, Zheyu Ma пишет:
quoted
During the process of driver probing, the probe function should return < 0
for failure, otherwise, the kernel will treat value > 0 as success.  
setup_card() checks for the return value.
Thus it makes sense to submit the patch with net-next tag
setup_card() propagates the value returned by setup_hw() which in turn
gets propagated by hfc_probe() and hits local_pci_probe():

	/*
	 * Probe function should return < 0 for failure, 0 for success
	 * Treat values > 0 as success, but warn.
	 */
	pci_warn(pci_dev, "Driver probe function unexpectedly returned %d\n",
		 rc);
	return 0;

But you're right, this is a minor bug, hfc_remove_pci() checks if
driver data is already NULL so there will be no crash. Just a driver
bound to a device even though probe failed. Still net material tho.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help