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

Commit 4daa2a80 authored by Pallipadi, Venkatesh's avatar Pallipadi, Venkatesh Committed by H. Peter Anvin
Browse files

x86, pat: In rbt_memtype_check_insert(), update new->type only if valid



new->type should only change when there is a valid ret_type. Otherwise
the requested type and return type should be same.

Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
LKML-Reference: <20100224214355.GA16431@linux-os.sc.intel.com>
Tested-by: default avatarJack Steiner <steiner@sgi.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 9e41a49a
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -223,7 +223,9 @@ int rbt_memtype_check_insert(struct memtype *new, unsigned long *ret_type)
						new->type, ret_type);
						new->type, ret_type);


	if (!err) {
	if (!err) {
		if (ret_type)
			new->type = *ret_type;
			new->type = *ret_type;

		memtype_rb_insert(&memtype_rbroot, new);
		memtype_rb_insert(&memtype_rbroot, new);
	}
	}
	return err;
	return err;