From: Heinz Mauelshagen Date: Tue, 7 Feb 2023 20:47:45 +0000 (+0100) Subject: dm ioctl: have constant on the right side of the test X-Git-Tag: v6.1.39~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27987794197e71309cb830944a849f470bd20431;p=platform%2Fkernel%2Flinux-starfive.git dm ioctl: have constant on the right side of the test [ Upstream commit 5cae0aa77397015f530aeb34f3ced32db6ac2875 ] Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer Stable-dep-of: 249bed821b4d ("dm ioctl: Avoid double-fetch of version") Signed-off-by: Sasha Levin --- diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 2ced382..6aeae09 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1819,8 +1819,8 @@ static int check_version(unsigned int cmd, struct dm_ioctl __user *user) if (copy_from_user(version, user->version, sizeof(version))) return -EFAULT; - if ((DM_VERSION_MAJOR != version[0]) || - (DM_VERSION_MINOR < version[1])) { + if ((version[0] != DM_VERSION_MAJOR) || + (version[1] > DM_VERSION_MINOR)) { DMERR("ioctl interface mismatch: kernel(%u.%u.%u), user(%u.%u.%u), cmd(%d)", DM_VERSION_MAJOR, DM_VERSION_MINOR, DM_VERSION_PATCHLEVEL,