summaryrefslogtreecommitdiff
path: root/source3/smbd/oplock.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/oplock.c')
-rw-r--r--source3/smbd/oplock.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index b23df3fdfa..067681e0f9 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -594,10 +594,16 @@ static void process_kernel_oplock_break(struct messaging_context *msg_ctx,
struct server_id src,
DATA_BLOB *data)
{
- struct smbd_server_connection *sconn;
struct file_id id;
unsigned long file_id;
files_struct *fsp;
+ struct smbd_server_connection *sconn =
+ talloc_get_type(private_data,
+ struct smbd_server_connection);
+
+ if (sconn == NULL) {
+ return;
+ }
if (data->data == NULL) {
DEBUG(0, ("Got NULL buffer\n"));
@@ -609,12 +615,6 @@ static void process_kernel_oplock_break(struct messaging_context *msg_ctx,
return;
}
- sconn = msg_ctx_to_sconn(msg_ctx);
- if (sconn == NULL) {
- DEBUG(1, ("could not find sconn\n"));
- return;
- }
-
/* Pull the data from the message. */
pull_file_id_24((char *)data->data, &id);
file_id = (unsigned long)IVAL(data->data, 24);
@@ -943,7 +943,7 @@ bool init_oplocks(struct smbd_server_connection *sconn)
process_oplock_async_level2_break_message);
messaging_register(sconn->msg_ctx, sconn, MSG_SMB_BREAK_RESPONSE,
process_oplock_break_response);
- messaging_register(sconn->msg_ctx, NULL, MSG_SMB_KERNEL_BREAK,
+ messaging_register(sconn->msg_ctx, sconn, MSG_SMB_KERNEL_BREAK,
process_kernel_oplock_break);
messaging_register(sconn->msg_ctx, NULL, MSG_SMB_OPEN_RETRY,
process_open_retry_message);