diff options
author | sam <sam@FreeBSD.org> | 2005-03-31 21:58:53 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-03-31 21:58:53 +0000 |
commit | 55bfc727adc4d17c3090622e123ba1718dd50ca5 (patch) | |
tree | a6b1d8060355cb77dd47044c11b0ddc3df17d831 /sys/dev/mlx | |
parent | 1c0a6f68b0b2a7279ab9b39f2712aea251093866 (diff) | |
download | FreeBSD-src-55bfc727adc4d17c3090622e123ba1718dd50ca5.zip FreeBSD-src-55bfc727adc4d17c3090622e123ba1718dd50ca5.tar.gz |
plug resource leak
Submitted by: mdodd
Noticed by: Coverity Prevent analysis tool
Diffstat (limited to 'sys/dev/mlx')
-rw-r--r-- | sys/dev/mlx/mlx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c index 844a265..dcee43c 100644 --- a/sys/dev/mlx/mlx.c +++ b/sys/dev/mlx/mlx.c @@ -1983,8 +1983,10 @@ mlx_user_command(struct mlx_softc *sc, struct mlx_usercommand *mu) * initial contents */ if (mu->mu_datasize > 0) { - if (mu->mu_datasize > MAXPHYS) - return (EINVAL); + if (mu->mu_datasize > MAXPHYS) { + error = EINVAL; + goto out; + } if (((kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK)) == NULL) || (error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) goto out; |