From 0a00d035f438724c7f5c96fff44cac5100d7a67a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 18 Dec 2019 07:39:17 +0100 Subject: [PATCH] 4.9-stable patches added patches: nvme-host-core-fix-precedence-of-ternary-operator.patch --- ...e-fix-precedence-of-ternary-operator.patch | 42 +++++++++++++++++++ queue-4.9/series | 1 + 2 files changed, 43 insertions(+) create mode 100644 queue-4.9/nvme-host-core-fix-precedence-of-ternary-operator.patch diff --git a/queue-4.9/nvme-host-core-fix-precedence-of-ternary-operator.patch b/queue-4.9/nvme-host-core-fix-precedence-of-ternary-operator.patch new file mode 100644 index 00000000000..9064ecd1761 --- /dev/null +++ b/queue-4.9/nvme-host-core-fix-precedence-of-ternary-operator.patch @@ -0,0 +1,42 @@ +From e9a9853c23c13a37546397b61b270999fd0fb759 Mon Sep 17 00:00:00 2001 +From: Ivan Bornyakov +Date: Wed, 23 May 2018 17:56:11 +0300 +Subject: nvme: host: core: fix precedence of ternary operator + +From: Ivan Bornyakov + +commit e9a9853c23c13a37546397b61b270999fd0fb759 upstream. + +Ternary operator have lower precedence then bitwise or, so 'cdw10' was +calculated wrong. + +Signed-off-by: Ivan Bornyakov +Reviewed-by: Max Gurtovoy +Signed-off-by: Keith Busch +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/nvme/host/core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -1043,7 +1043,7 @@ static int nvme_pr_reserve(struct block_ + static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new, + enum pr_type type, bool abort) + { +- u32 cdw10 = nvme_pr_type(type) << 8 | abort ? 2 : 1; ++ u32 cdw10 = nvme_pr_type(type) << 8 | (abort ? 2 : 1); + return nvme_pr_command(bdev, cdw10, old, new, nvme_cmd_resv_acquire); + } + +@@ -1055,7 +1055,7 @@ static int nvme_pr_clear(struct block_de + + static int nvme_pr_release(struct block_device *bdev, u64 key, enum pr_type type) + { +- u32 cdw10 = nvme_pr_type(type) << 8 | key ? 1 << 3 : 0; ++ u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 1 << 3 : 0); + return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release); + } + diff --git a/queue-4.9/series b/queue-4.9/series index a7ea8d3d101..1c24d881b33 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -172,3 +172,4 @@ workqueue-fix-missing-kfree-rescuer-in-destroy_workqueue.patch sunrpc-fix-crash-when-cache_head-become-valid-before.patch net-mlx5e-fix-sff-8472-eeprom-length.patch kernel-module.c-wakeup-processes-in-module_wq-on-mod.patch +nvme-host-core-fix-precedence-of-ternary-operator.patch -- 2.47.3