User: | Jiri Slaby |
Error type: | Leaving function in locked state |
Error type description: | Some lock is not unlocked on all paths of a function, so it is leaked |
File location: | fs/fuse/dev.c |
Line in file: | 977 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Undetermined 1
|
Entered: | 2012-03-04 17:07:06 UTC |
947 struct fuse_conn *fc = fuse_get_conn(file); 948 if (!fc) 949 return POLLERR; 950 951 poll_wait(file, &fc->waitq, wait); 952 953 spin_lock(&fc->lock); 954 if (!fc->connected) 955 mask = POLLERR; 956 else if (request_pending(fc)) 957 mask |= POLLIN | POLLRDNORM; 958 spin_unlock(&fc->lock); 959 960 return mask; 961} 962 963/* 964 * Abort all requests on the given list (pending or processing) 965 * 966 * This function releases and reacquires fc->lock 967 */ 968static void end_requests(struct fuse_conn *fc, struct list_head *head) 969{ 970 while (!list_empty(head)) { 971 struct fuse_req *req; 972 req = list_entry(head->next, struct fuse_req, list); 973 req->out.h.error = -ECONNABORTED; 974 request_end(fc, req); 975 spin_lock(&fc->lock); 976 } 977} 978 979/* 980 * Abort requests under I/O 981 * 982 * The requests are set to aborted and finished, and the request 983 * waiter is woken up. This will make request_wait_answer() wait 984 * until the request is unlocked and then return. 985 * 986 * If the request is asynchronous, then the end function needs to be 987 * called after waiting for the request to be unlocked (if it was