rx: Some kernels have no reschedule function
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 3 Dec 2011 21:10:43 +0000 (21:10 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 3 Dec 2011 23:18:29 +0000 (15:18 -0800)
If RXK_TIMEDSLEEP_ENV isn't set, then Unix kernel cache managers
call rxevent_Init without a reschedule function. Check for this so
we don't end up calling a NULL function in these situations.

Change-Id: I5e89f5247aeffc4c27d3f81c0ccabe4979232846
Reviewed-on: http://gerrit.openafs.org/6206
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/rx/rx_event.c

index 6baf8a8..7f9c3c7 100644 (file)
@@ -285,7 +285,8 @@ rxevent_Post(struct clock *when, struct clock *now,
        eventSchedule.raised = 1;
        clock_Zero(&eventSchedule.next);
        MUTEX_EXIT(&eventTree.lock);
-       (*eventSchedule.func)();
+       if (eventSchedule.func != NULL)
+           (*eventSchedule.func)();
        return rxevent_get(ev);
     }