diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-16 15:17:41 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-16 15:17:41 +0000 |
commit | 03c67e60a70083cf2ad3f60af5104127d22a9c8f (patch) | |
tree | 806ffc14476dce1cd029133c7c661fa73a44cb83 | |
parent | 41670f3559eeff21dcdfb32af98be2d367b9816d (diff) | |
download | mdevd-03c67e60a70083cf2ad3f60af5104127d22a9c8f.tar.xz |
Bugfix: fd leak on datafd errors when loading firmware. version: 0.1.0.1v0.1.0.1
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | doc/index.html | 2 | ||||
-rw-r--r-- | doc/upgrade.html | 6 | ||||
-rw-r--r-- | examples/s6-rc/mdevd/run | 2 | ||||
-rwxr-xr-x | examples/s6/mdevd/run | 2 | ||||
-rw-r--r-- | package/info | 2 | ||||
-rw-r--r-- | src/mdevd/mdevd.c | 9 |
7 files changed, 21 insertions, 8 deletions
@@ -1,5 +1,11 @@ Changelog for mdevd. +In 0.1.0.1 +---------- + + - Bugfixes. + + In 0.1.0.0 ---------- diff --git a/doc/index.html b/doc/index.html index b770bd4..7d173dc 100644 --- a/doc/index.html +++ b/doc/index.html @@ -69,7 +69,7 @@ library. </li> <ul> <li> The current released version of mdevd is -<a href="mdevd-0.1.0.0.tar.gz">0.1.0.0</a>. </li> +<a href="mdevd-0.1.0.1.tar.gz">0.1.0.1</a>. </li> <li> Alternatively, you can checkout a copy of the <a href="//git.skarnet.org/cgi-bin/cgit.cgi/mdevd/">mdevd git repository</a>: diff --git a/doc/upgrade.html b/doc/upgrade.html index 65e18f6..11144f2 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -18,6 +18,12 @@ <h1> What has changed in mdevd </h1> +<h2> in 0.1.0.1 </h2> + +<ul> + <li> No functional changes. </li> +</ul> + <h2> in 0.1.0.0 </h2> <ul> diff --git a/examples/s6-rc/mdevd/run b/examples/s6-rc/mdevd/run index aa8db86..91dedd0 100644 --- a/examples/s6-rc/mdevd/run +++ b/examples/s6-rc/mdevd/run @@ -1 +1 @@ -mdevd -D 3 +mdevd -D 3 -b 200000 diff --git a/examples/s6/mdevd/run b/examples/s6/mdevd/run index 3b16054..8ffabd7 100755 --- a/examples/s6/mdevd/run +++ b/examples/s6/mdevd/run @@ -1,3 +1,3 @@ #!/bin/execlineb -P exec -c -mdevd -D 3 +mdevd -D 3 -b 200000 diff --git a/package/info b/package/info index 1c86703..ab75260 100644 --- a/package/info +++ b/package/info @@ -1,4 +1,4 @@ package=mdevd -version=0.1.0.0 +version=0.1.0.1 category=admin package_macro_name=MDEVD diff --git a/src/mdevd/mdevd.c b/src/mdevd/mdevd.c index 54e5cf6..e395cac 100644 --- a/src/mdevd/mdevd.c +++ b/src/mdevd/mdevd.c @@ -541,7 +541,7 @@ static inline void load_firmware (char const *fw, char const *sysdevpath) size_t fwbaselen = strlen(fwbase) ; size_t fwlen = strlen(fw) ; size_t sysdevpathlen = strlen(sysdevpath) ; - int fwfd, loadingfd ; + int fwfd, loadingfd, datafd ; char fwfn[fwbaselen + fwlen + 2] ; memcpy(fwfn, fwbase, fwbaselen) ; fwfn[fwbaselen] = '/' ; @@ -566,7 +566,6 @@ static inline void load_firmware (char const *fw, char const *sysdevpath) goto errclosel ; } { - int datafd ; char datafn[sysdevpathlen + 6] ; memcpy(datafn, sysdevpath, sysdevpathlen) ; memcpy(datafn + sysdevpathlen, "/data", 6) ; @@ -579,12 +578,12 @@ static inline void load_firmware (char const *fw, char const *sysdevpath) if (ndelay_off(datafd) < 0) { if (verbosity >= 2) strerr_warnwu2sys("ndelay_off ", datafn) ; - goto errload ; + goto errdata ; } if (fd_cat(fwfd, datafd) < 0) { if (verbosity >= 2) strerr_warnwu4sys("copy ", fwfn, " to ", datafn) ; - goto errload ; + goto errdata ; } fd_close(datafd) ; fd_write(loadingfd, "0", 1) ; @@ -593,6 +592,8 @@ static inline void load_firmware (char const *fw, char const *sysdevpath) fd_close(fwfd) ; return ; + errdata: + fd_close(datafd) ; errload: allwrite(loadingfd, "-1", 2) ; errclosel: |