bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/5] libshouldbeinlibc: fix error handling in maptime_map


From: Justus Winter
Subject: [PATCH 4/5] libshouldbeinlibc: fix error handling in maptime_map
Date: Fri, 25 Oct 2013 10:30:23 +0200

Found using the Clang Static Analyzer.

* libshouldbeinlibc/maptime.c (maptime_map): Fix error handling.
---
 libshouldbeinlibc/maptime.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libshouldbeinlibc/maptime.c b/libshouldbeinlibc/maptime.c
index bc75045..cacf4b6 100644
--- a/libshouldbeinlibc/maptime.c
+++ b/libshouldbeinlibc/maptime.c
@@ -47,6 +47,8 @@ maptime_map (int use_mach_dev, char *dev_name,
        {
          err = device_open (device_master, 0, dev_name ?: "time", &device);
          mach_port_deallocate (mach_task_self (), device_master);
+         if (err)
+           return err;
        }
 
       err = device_map (device, VM_PROT_READ, 0, sizeof *mtime, &memobj, 0);
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]