From 730eb840112f942092aa9bf9edf4dfa30e10a61c Mon Sep 17 00:00:00 2001 From: David Schultz Date: Fri, 18 Mar 2005 05:43:37 +0000 Subject: [PATCH] If mlx_attach() returns an error, don't free sc again. Spotted by: Ted Unangst using the Coverity Prevent static analysis tool Reviewed by: scottl --- sys/dev/mlx/mlx_pci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/mlx/mlx_pci.c b/sys/dev/mlx/mlx_pci.c index 6c2fe87e6e9..7e4b01ac627 100644 --- a/sys/dev/mlx/mlx_pci.c +++ b/sys/dev/mlx/mlx_pci.c @@ -214,10 +214,8 @@ mlx_pci_attach(device_t dev) * Do bus-independant initialisation. */ error = mlx_attach(sc); - if (error != 0) { - mlx_free(sc); + if (error != 0) return(error); - } /* * Start the controller.