]> Zhao Yanbai Git Server - minix.git/commitdiff
libnetsock: resolve Coverity warnings
authorDavid van Moolenbroek <david@minix3.org>
Tue, 7 Aug 2012 11:10:36 +0000 (13:10 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Wed, 8 Aug 2012 22:16:36 +0000 (00:16 +0200)
lib/libnetsock/socket.c

index 96f0000e724a2100fefd1adc7efdefd7b32e6038..7897a126e89f2cb58a2e320ef78fc5f528304639 100644 (file)
@@ -319,19 +319,19 @@ static void socket_request_socket(struct socket * sock, message * m)
 
        switch (m->m_type) {
        case DEV_READ_S:
-               if (sock && sock->ops && sock->ops->read)
+               if (sock->ops && sock->ops->read)
                        sock->ops->read(sock, m, blocking);
                else
                        send_reply(m, EINVAL);
                return;
        case DEV_WRITE_S:
-               if (sock && sock->ops && sock->ops->write)
+               if (sock->ops && sock->ops->write)
                        sock->ops->write(sock, m, blocking);
                else
                        send_reply(m, EINVAL);
                return;
        case DEV_IOCTL_S:
-               if (sock && sock->ops && sock->ops->ioctl)
+               if (sock->ops && sock->ops->ioctl)
                        sock->ops->ioctl(sock, m, blocking);
                else
                        send_reply(m, EINVAL);
@@ -352,7 +352,7 @@ void socket_request(message * m)
                return;
        case DEV_CLOSE:
                sock = get_sock(m->DEVICE);
-               if (sock && sock->ops && sock->ops->close) {
+               if (sock->ops && sock->ops->close) {
                        sock->flags &= ~SOCK_FLG_OP_PENDING;
                        sock->mess = *m;
                        sock->ops->close(sock, m);
@@ -419,7 +419,7 @@ void socket_request(message * m)
                sock = get_sock(m->DEVICE);
                assert(sock->select_ep == NONE || sock->select_ep == m->m_source);
 
-               if (sock && sock->ops && sock->ops->select) {
+               if (sock->ops && sock->ops->select) {
                        sock->select_ep = m->m_source;
                        sock->ops->select(sock, m);
                        if (!sock_select_set(sock))