aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-10-12 11:59:42 -0400
committerAlasdair G Kergon <agk@redhat.com>2012-10-12 11:59:42 -0400
commita71a261f5c39685698f7f1970dc7046b36e132d1 (patch)
treeda8d0847828584d2788244d07c33a4422e489e50 /drivers/md
parentce40be7a820bb393ac4ac69865f018d2f4038cf0 (diff)
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')
-rw-r--r--drivers/md/dm-mpath.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index d778563a4ffd..573bd04591bf 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,
1309{ 1309{
1310 struct multipath *m = ti->private; 1310 struct multipath *m = ti->private;
1311 struct dm_mpath_io *mpio = map_context->ptr; 1311 struct dm_mpath_io *mpio = map_context->ptr;
1312 struct pgpath *pgpath = mpio->pgpath; 1312 struct pgpath *pgpath;
1313 struct path_selector *ps; 1313 struct path_selector *ps;
1314 int r; 1314 int r;
1315 1315
1316 BUG_ON(!mpio); 1316 BUG_ON(!mpio);
1317 1317
1318 r = do_end_io(m, clone, error, mpio); 1318 r = do_end_io(m, clone, error, mpio);
1319 pgpath = mpio->pgpath;
1319 if (pgpath) { 1320 if (pgpath) {
1320 ps = &pgpath->pg->ps; 1321 ps = &pgpath->pg->ps;
1321 if (ps->type->end_io) 1322 if (ps->type->end_io)