Check for null location before setting errno and retval.
authorDavid Zhu <yuzhu@cs.berkeley.edu>
Mon, 16 Aug 2010 22:09:56 +0000 (15:09 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:51 +0000 (17:35 -0700)
kern/src/syscall.c

index 4ad2fcf..8acfa8e 100644 (file)
@@ -1298,5 +1298,6 @@ void set_retval(uint32_t retval)
 void set_errno(uint32_t errno)
 {
        struct per_cpu_info* coreinfo = &per_cpu_info[core_id()];
-       *(coreinfo->cur_ret.errno_loc) = errno;
+       if (coreinfo && coreinfo->cur_ret.errno_loc)
+               *(coreinfo->cur_ret.errno_loc) = errno;
 }