Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a71a261f authored by Wei Yongjun's avatar Wei Yongjun Committed by Alasdair G Kergon
Browse files

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent ce40be7a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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)