]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
sync/EventKqueue.cc: fix possible null pointer dereference
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 7 Jan 2015 15:15:33 +0000 (16:15 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 3 Feb 2015 21:51:07 +0000 (22:51 +0100)
Remove pointer deref before NULL check. These lines are already
after NULL check.

Fix for:
[src/msg/async/EventKqueue.cc:96] -> [src/msg/async/EventKqueue.cc:99]:
 (warning) Possible null pointer dereference: tvp - otherwise it is
 redundant to check it against null.
[src/msg/async/EventKqueue.cc:97] -> [src/msg/async/EventKqueue.cc:99]:
 (warning) Possible null pointer dereference: tvp - otherwise it is
 redundant to check it against null.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/msg/async/EventKqueue.cc

index 13dba68b7e6b467200fd780a89983d7469afc767..10156da17755c28bf9bbcf68298a15a755f6dc53 100644 (file)
@@ -93,8 +93,6 @@ int KqueueDriver::event_wait(vector<FiredFileEvent> &fired_events, struct timeva
 {
   int retval, numevents = 0;
   struct timespec timeout;
-  timeout.tv_sec = tvp->tv_sec;
-  timeout.tv_nsec = tvp->tv_usec * 1000;
 
   if (tvp != NULL) {
       timeout.tv_sec = tvp->tv_sec;