return NULL;
 }
 
-static void io_account_cq_overflow(struct io_ring_ctx *ctx)
-{
-       struct io_rings *r = ctx->rings;
-
-       WRITE_ONCE(r->cq_overflow, READ_ONCE(r->cq_overflow) + 1);
-       ctx->cq_extra--;
-}
-
 static void io_clean_op(struct io_kiocb *req)
 {
        if (unlikely(req->flags & REQ_F_BUFFER_SELECTED))
        ocqe = kmalloc(ocq_size, GFP_ATOMIC | __GFP_ACCOUNT);
        trace_io_uring_cqe_overflow(ctx, user_data, res, cflags, ocqe);
        if (!ocqe) {
+               struct io_rings *r = ctx->rings;
+
                /*
                 * If we're in ring overflow flush mode, or in task cancel mode,
                 * or cannot allocate an overflow entry, then we need to drop it
                 * on the floor.
                 */
-               io_account_cq_overflow(ctx);
+               WRITE_ONCE(r->cq_overflow, READ_ONCE(r->cq_overflow) + 1);
+               ctx->cq_extra--;
                set_bit(IO_CHECK_CQ_DROPPED_BIT, &ctx->check_cq);
                return false;
        }