[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <87d2f9ds17.fsf@elisp.net>
Date: Tue, 20 May 2014 12:53:56 +0900
From: naota@...sp.net
To: Joe Thornber <ejt@...hat.com>, dm-devel@...hat.com
Cc: Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] dm: check era->md is non-NULL before closing it
In era_ctr(), era->md remain NULL until it's set after metadata_open().
On the other hand, era_destroy() assume era->md is non-NULL and it is
called by era_ctr() before initializing the value.
This patch just checks if era->md is non-NULL.
Signed-off-by: Naohiro Aota <naota@...sp.net>
---
drivers/md/dm-era-target.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c
index 414dad4..ad913cd 100644
--- a/drivers/md/dm-era-target.c
+++ b/drivers/md/dm-era-target.c
@@ -1391,7 +1391,8 @@ static int era_is_congested(struct dm_target_callbacks *cb, int bdi_bits)
static void era_destroy(struct era *era)
{
- metadata_close(era->md);
+ if (era->md)
+ metadata_close(era->md);
if (era->wq)
destroy_workqueue(era->wq);
--
1.9.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists