Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753176AbeADObz (ORCPT + 1 other); Thu, 4 Jan 2018 09:31:55 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:44345 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753053AbeADOby (ORCPT ); Thu, 4 Jan 2018 09:31:54 -0500 X-Google-Smtp-Source: ACJfBouB+CMF/o3Na11EpdmgxHO4bPb+9SeECmv6I4A7EJqOvQy/hx0TuNzxrP5PZsopIdmTS/O02Q== From: Xiongwei Song To: agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH] dm bufio: fix missed destroy of mutex c->lock Date: Thu, 4 Jan 2018 22:31:26 +0800 Message-Id: <20180104143126.29339-1-sxwjean@gmail.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: The mutex c->lock is initialized in dm_bufio_client_create, however, it is not destroyed before free the structure of dm_bufio_client in dm_bufio_client_destroy. Signed-off-by: Xiongwei Song --- drivers/md/dm-bufio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index c546b567f3b5..53c0d5d2039a 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -1811,6 +1811,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c) BUG_ON(c->n_buffers[i]); dm_io_client_destroy(c->dm_io); + mutex_destroy(&c->lock); kfree(c); } EXPORT_SYMBOL_GPL(dm_bufio_client_destroy); -- 2.15.1