3.15-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Joe Thornber <[email protected]>

commit 989f26f5ad308f40a95f280bf9cd75e558d4f18d upstream.

era_ctr() may call era_destroy() before era->md is initialized so
era_destory() must only close the metadata object if it is not NULL.

Signed-off-by: Joe Thornber <[email protected]>
Signed-off-by: Naohiro Aota <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/md/dm-era-target.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- 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_ta
 
 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);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to