diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-12 15:59:42 (GMT) |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-10-12 15:59:42 (GMT) |
commit | a71a261f5c39685698f7f1970dc7046b36e132d1 (patch) | |
tree | da8d0847828584d2788244d07c33a4422e489e50 /drivers/md/dm-mpath.c | |
parent | ce40be7a820bb393ac4ac69865f018d2f4038cf0 (diff) | |
download | linux-a71a261f5c39685698f7f1970dc7046b36e132d1.tar.xz |
dm mpath: fix check for null mpio in end_io fn
The mpio dereference should be moved below the BUG_ON NULL test
in multipath_end_io().
spatch with a semantic match was used to found this.
(http://coccinelle.lip6.fr/)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r-- | drivers/md/dm-mpath.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d778563..573bd04 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) |