mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	uio/uio_pci_generic: don't return zero on failure path in probe()
If uio_register_device() fails in probe(), it breaks off initialization, deallocates all resources, but returns zero. The patch adds proper error code propagation. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
		
							parent
							
								
									5de61e7aa1
								
							
						
					
					
						commit
						c4277e9ea7
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -91,7 +91,8 @@ static int probe(struct pci_dev *pdev, | |||
| 	gdev->info.handler = irqhandler; | ||||
| 	gdev->pdev = pdev; | ||||
| 
 | ||||
| 	if (uio_register_device(&pdev->dev, &gdev->info)) | ||||
| 	err = uio_register_device(&pdev->dev, &gdev->info); | ||||
| 	if (err) | ||||
| 		goto err_register; | ||||
| 	pci_set_drvdata(pdev, gdev); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Alexey Khoroshilov
						Alexey Khoroshilov