CIFS: Make accessing is_valid_oplock/dump_detail ops struct field safe
authorPavel Shilovsky <pshilovsky@samba.org>
Mon, 28 May 2012 11:50:10 +0000 (15:50 +0400)
committerSteve French <sfrench@us.ibm.com>
Fri, 1 Jun 2012 17:35:16 +0000 (12:35 -0500)
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/connect.c

index ccafdedd0dbc4df14e04c0087d28b1dfa453be1f..3647b1a4540b070c5cacb9e8aeedefd90edd9927 100644 (file)
@@ -1058,13 +1058,15 @@ cifs_demultiplex_thread(void *p)
                if (mid_entry != NULL) {
                        if (!mid_entry->multiRsp || mid_entry->multiEnd)
                                mid_entry->callback(mid_entry);
-               } else if (!server->ops->is_oplock_break(buf, server)) {
+               } else if (!server->ops->is_oplock_break ||
+                          !server->ops->is_oplock_break(buf, server)) {
                        cERROR(1, "No task to wake, unknown frame received! "
                                   "NumMids %d", atomic_read(&midCount));
                        cifs_dump_mem("Received Data is: ", buf,
                                      HEADER_SIZE(server));
 #ifdef CONFIG_CIFS_DEBUG2
-                       server->ops->dump_detail(buf);
+                       if (server->ops->dump_detail)
+                               server->ops->dump_detail(buf);
                        cifs_dump_mids(server);
 #endif /* CIFS_DEBUG2 */