Josh Boyer bc12142
--- linux-2.6.39.noarch/block/elevator.c~	2011-08-09 10:07:41.532774872 -0400
Josh Boyer bc12142
+++ linux-2.6.39.noarch/block/elevator.c	2011-08-09 10:07:56.131724173 -0400
Josh Boyer bc12142
@@ -815,7 +815,7 @@ void elv_completed_request(struct reques
Josh Boyer bc12142
 	 */
Josh Boyer bc12142
 	if (blk_account_rq(rq)) {
Josh Boyer bc12142
 		q->in_flight[rq_is_sync(rq)]--;
Josh Boyer bc12142
-		if ((rq->cmd_flags & REQ_SORTED) &&
Josh Boyer bc12142
+		if ((rq->cmd_flags & REQ_SORTED) && e->ops &&
Josh Boyer bc12142
 		    e->ops->elevator_completed_req_fn)
Josh Boyer bc12142
 			e->ops->elevator_completed_req_fn(q, rq);
Josh Boyer bc12142
 	}