From: Wei Yongjun Date: Mon, 17 Sep 2012 01:01:01 +0000 (+1000) Subject: The mpio dereference should be moved below the BUG_ON NULL test X-Git-Tag: next-20120917~60^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ca4aff6ea719499d8ea18cd54548759342f86855;p=karo-tx-linux.git The mpio dereference should be moved below the BUG_ON NULL test in multipath_end_io(). spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d8abb90a6c2f..7b494e64348c 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1309,13 +1309,14 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone, { struct multipath *m = ti->private; struct dm_mpath_io *mpio = map_context->ptr; - struct pgpath *pgpath = mpio->pgpath; + struct pgpath *pgpath; struct path_selector *ps; int r; BUG_ON(!mpio); r = do_end_io(m, clone, error, mpio); + pgpath = mpio->pgpath; if (pgpath) { ps = &pgpath->pg->ps; if (ps->type->end_io)