diff options
author | Steve French <smfrench@gmail.com> | 2018-02-03 20:45:07 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2018-02-07 10:36:43 -0500 |
commit | f9de151bf2b8055563b85ff6896fd86891bbe6c5 (patch) | |
tree | 283d4d14dc93b7327714d7d753a219f9a308df35 | |
parent | ade7db991b47ab3016a414468164f4966bd08202 (diff) |
address lock imbalance warnings in smbdirect.c
Although at least one of these was an overly strict sparse warning
in the new smbdirect code, it is cleaner to fix - so no warnings.
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
-rw-r--r-- | fs/cifs/smbdirect.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 5130492847eb..91710eb571fb 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c | |||
@@ -217,9 +217,10 @@ static void smbd_destroy_rdma_work(struct work_struct *work) | |||
217 | spin_unlock_irqrestore( | 217 | spin_unlock_irqrestore( |
218 | &info->reassembly_queue_lock, flags); | 218 | &info->reassembly_queue_lock, flags); |
219 | put_receive_buffer(info, response); | 219 | put_receive_buffer(info, response); |
220 | } | 220 | } else |
221 | spin_unlock_irqrestore(&info->reassembly_queue_lock, flags); | ||
221 | } while (response); | 222 | } while (response); |
222 | spin_unlock_irqrestore(&info->reassembly_queue_lock, flags); | 223 | |
223 | info->reassembly_data_length = 0; | 224 | info->reassembly_data_length = 0; |
224 | 225 | ||
225 | log_rdma_event(INFO, "free receive buffers\n"); | 226 | log_rdma_event(INFO, "free receive buffers\n"); |
@@ -1934,15 +1935,16 @@ again: | |||
1934 | * No need to lock if we are not at the | 1935 | * No need to lock if we are not at the |
1935 | * end of the queue | 1936 | * end of the queue |
1936 | */ | 1937 | */ |
1937 | if (!queue_length) | 1938 | if (queue_length) |
1939 | list_del(&response->list); | ||
1940 | else { | ||
1938 | spin_lock_irq( | 1941 | spin_lock_irq( |
1939 | &info->reassembly_queue_lock); | 1942 | &info->reassembly_queue_lock); |
1940 | list_del(&response->list); | 1943 | list_del(&response->list); |
1941 | queue_removed++; | ||
1942 | if (!queue_length) | ||
1943 | spin_unlock_irq( | 1944 | spin_unlock_irq( |
1944 | &info->reassembly_queue_lock); | 1945 | &info->reassembly_queue_lock); |
1945 | 1946 | } | |
1947 | queue_removed++; | ||
1946 | info->count_reassembly_queue--; | 1948 | info->count_reassembly_queue--; |
1947 | info->count_dequeue_reassembly_queue++; | 1949 | info->count_dequeue_reassembly_queue++; |
1948 | put_receive_buffer(info, response); | 1950 | put_receive_buffer(info, response); |