From 978c3d52701afe5ccd2fcae854b6b2bcc24bc10a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 6 May 2021 17:32:21 +0000 Subject: Cosmetic fix --- src/mdevd/mdevd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mdevd/mdevd.c b/src/mdevd/mdevd.c index ba65fe8..06324eb 100644 --- a/src/mdevd/mdevd.c +++ b/src/mdevd/mdevd.c @@ -537,7 +537,7 @@ static inline int wait_for_loading (char const *sysdevpath, size_t sysdevpathlen tain_add_g(&deadline, &period) ; deepsleepuntil_g(&deadline) ; } - if (ndelay_off(lfd) < 0) + if (lfd >= 0 && ndelay_off(lfd) < 0) { fd_close(lfd) ; return -1 ; -- cgit 1.4.1