]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
The mpio dereference should be moved below the BUG_ON NULL test
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 24 Sep 2012 00:22:53 +0000 (10:22 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 24 Sep 2012 00:22:53 +0000 (10:22 +1000)
in multipath_end_io().

spatch with a semantic match is 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>
drivers/md/dm-mpath.c

index d8abb90a6c2fbecae99ae2de09ebc2f3d726731e..7b494e64348cfcb41f6459a15a0d40869e8e43b9 100644 (file)
@@ -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)