diff options
author | das <das@FreeBSD.org> | 2005-03-18 05:43:37 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2005-03-18 05:43:37 +0000 |
commit | c1de26c2a069664351ad0a5c53456d34e9e29e5e (patch) | |
tree | 6d698e26612955fd0dc67c366868b4597c26f82e /sys/dev/mlx | |
parent | 64406ce1fb5254fb3009150968e2acc45648725e (diff) | |
download | FreeBSD-src-c1de26c2a069664351ad0a5c53456d34e9e29e5e.zip FreeBSD-src-c1de26c2a069664351ad0a5c53456d34e9e29e5e.tar.gz |
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
Diffstat (limited to 'sys/dev/mlx')
-rw-r--r-- | sys/dev/mlx/mlx_pci.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/dev/mlx/mlx_pci.c b/sys/dev/mlx/mlx_pci.c index 6c2fe87..7e4b01a 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. |