Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751476AbaDSKBF (ORCPT ); Sat, 19 Apr 2014 06:01:05 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:50190 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751043AbaDSKAf (ORCPT ); Sat, 19 Apr 2014 06:00:35 -0400 From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: Christoph Hellwig , Ming Lei Subject: [PATCH v1 next 1/4] blk-mq: free hctx->ctx_map when init failed Date: Sat, 19 Apr 2014 18:00:16 +0800 Message-Id: <1397901619-27226-2-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397901619-27226-1-git-send-email-tom.leiming@gmail.com> References: <1397901619-27226-1-git-send-email-tom.leiming@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid memory leak in the failure path. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- block/blk-mq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index ee225cc..5fbbb22 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1289,6 +1289,7 @@ static int blk_mq_init_hw_queues(struct request_queue *q, blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier); kfree(hctx->ctxs); + kfree(hctx->ctx_map); } return 1; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/