From: Greg Kroah-Hartman Date: Mon, 2 May 2016 23:56:24 +0000 (-0700) Subject: 4.4-stable patches X-Git-Tag: v3.14.68~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=376b84284c3e2bd4385f9be6b7e333075cd94b36;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch unbreak-allmodconfig-kconfig_allconfig.patch --- diff --git a/queue-4.4/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch b/queue-4.4/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch new file mode 100644 index 00000000000..0d6f80dc2ed --- /dev/null +++ b/queue-4.4/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch @@ -0,0 +1,54 @@ +From 3deb9438d34a09f6796639b652a01d110aca9f75 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 14 Mar 2016 15:29:45 +0100 +Subject: megaraid_sas: add missing curly braces in ioctl handler + +From: Arnd Bergmann + +commit 3deb9438d34a09f6796639b652a01d110aca9f75 upstream. + +gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl +function: + +drivers/scsi/megaraid/megaraid_sas_base.c: In function 'megasas_mgmt_fw_ioctl': +drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation] + kbuff_arr[i] = NULL; + ^~~~~~~~~ +drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but it is not + if (kbuff_arr[i]) + ^~ + +The code is actually correct, as there is no downside in clearing a NULL +pointer again. + +This clarifies the code and avoids the warning by adding extra curly +braces. + +Signed-off-by: Arnd Bergmann +Fixes: 90dc9d98f01b ("megaraid_sas : MFI MPT linked list corruption fix") +Reviewed-by: Hannes Reinecke +Acked-by: Sumit Saxena +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/megaraid/megaraid_sas_base.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/scsi/megaraid/megaraid_sas_base.c ++++ b/drivers/scsi/megaraid/megaraid_sas_base.c +@@ -6282,12 +6282,13 @@ out: + } + + for (i = 0; i < ioc->sge_count; i++) { +- if (kbuff_arr[i]) ++ if (kbuff_arr[i]) { + dma_free_coherent(&instance->pdev->dev, + le32_to_cpu(kern_sge32[i].length), + kbuff_arr[i], + le32_to_cpu(kern_sge32[i].phys_addr)); + kbuff_arr[i] = NULL; ++ } + } + + megasas_return_cmd(instance, cmd); diff --git a/queue-4.4/series b/queue-4.4/series index f451388355a..7fc08332da9 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -155,3 +155,7 @@ arm-dts-pxa-fix-dma-engine-node-to-pxa3xx-nand.patch bus-imx-weim-take-the-status-property-value-into-account.patch jme-do-not-enable-nic-wol-functions-on-s0.patch jme-fix-device-pm-wakeup-api-usage.patch +unbreak-allmodconfig-kconfig_allconfig.patch +thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch +sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch +megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch diff --git a/queue-4.4/sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch b/queue-4.4/sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch new file mode 100644 index 00000000000..6ad75e2dcd4 --- /dev/null +++ b/queue-4.4/sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch @@ -0,0 +1,45 @@ +From a6ab1e8126d205238defbb55d23661a3a5c6a0d8 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Fri, 4 Mar 2016 17:20:13 +1100 +Subject: sunrpc/cache: drop reference when sunrpc_cache_pipe_upcall() detects a race + +From: NeilBrown + +commit a6ab1e8126d205238defbb55d23661a3a5c6a0d8 upstream. + +sunrpc_cache_pipe_upcall() can detect a race if CACHE_PENDING is no longer +set. In this case it aborts the queuing of the upcall. +However it has already taken a new counted reference on "h" and +doesn't "put" it, even though it frees the data structure holding the reference. + +So let's delay the "cache_get" until we know we need it. + +Fixes: f9e1aedc6c79 ("sunrpc/cache: remove races with queuing an upcall.") +Signed-off-by: NeilBrown +Signed-off-by: J. Bruce Fields +Signed-off-by: Greg Kroah-Hartman + +--- + net/sunrpc/cache.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/net/sunrpc/cache.c ++++ b/net/sunrpc/cache.c +@@ -1182,14 +1182,14 @@ int sunrpc_cache_pipe_upcall(struct cach + } + + crq->q.reader = 0; +- crq->item = cache_get(h); + crq->buf = buf; + crq->len = 0; + crq->readers = 0; + spin_lock(&queue_lock); +- if (test_bit(CACHE_PENDING, &h->flags)) ++ if (test_bit(CACHE_PENDING, &h->flags)) { ++ crq->item = cache_get(h); + list_add_tail(&crq->q.list, &detail->queue); +- else ++ } else + /* Lost a race, no longer PENDING, so don't enqueue */ + ret = -EAGAIN; + spin_unlock(&queue_lock); diff --git a/queue-4.4/thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch b/queue-4.4/thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch new file mode 100644 index 00000000000..4b1813ea3a8 --- /dev/null +++ b/queue-4.4/thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch @@ -0,0 +1,54 @@ +From 43b4eb9fe719b107c8e5d49d1edbff0c135a42cb Mon Sep 17 00:00:00 2001 +From: Caesar Wang +Date: Mon, 15 Feb 2016 15:33:28 +0800 +Subject: thermal: rockchip: fix a impossible condition caused by the warning + +From: Caesar Wang + +commit 43b4eb9fe719b107c8e5d49d1edbff0c135a42cb upstream. + +As the Dan report the smatch check the thermal driver warning: +drivers/thermal/rockchip_thermal.c:551 rockchip_configure_from_dt() +warn: impossible condition '(thermal->tshut_temp > ((~0 >> 1))) => +(s32min-s32max > s32max)' + +Although The shut_temp read from DT is u32,the temperature is currently +represented as int not long in the thermal driver. +Let's change to make shut_temp instead of the thermal->tshut_temp for +the condition. + +Fixes: commit 437df2172e8d +("thermal: rockchip: consistently use int for temperatures") + +Reported-by: Dan Carpenter +Signed-off-by: Caesar Wang +Signed-off-by: Eduardo Valentin +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/thermal/rockchip_thermal.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +--- a/drivers/thermal/rockchip_thermal.c ++++ b/drivers/thermal/rockchip_thermal.c +@@ -545,15 +545,14 @@ static int rockchip_configure_from_dt(st + thermal->chip->tshut_temp); + thermal->tshut_temp = thermal->chip->tshut_temp; + } else { ++ if (shut_temp > INT_MAX) { ++ dev_err(dev, "Invalid tshut temperature specified: %d\n", ++ shut_temp); ++ return -ERANGE; ++ } + thermal->tshut_temp = shut_temp; + } + +- if (thermal->tshut_temp > INT_MAX) { +- dev_err(dev, "Invalid tshut temperature specified: %d\n", +- thermal->tshut_temp); +- return -ERANGE; +- } +- + if (of_property_read_u32(np, "rockchip,hw-tshut-mode", &tshut_mode)) { + dev_warn(dev, + "Missing tshut mode property, using default (%s)\n", diff --git a/queue-4.4/unbreak-allmodconfig-kconfig_allconfig.patch b/queue-4.4/unbreak-allmodconfig-kconfig_allconfig.patch new file mode 100644 index 00000000000..e303b61ed9f --- /dev/null +++ b/queue-4.4/unbreak-allmodconfig-kconfig_allconfig.patch @@ -0,0 +1,76 @@ +From 6b87b70c5339f30e3c5b32085e69625906513dc2 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Thu, 14 Jan 2016 18:13:49 +0000 +Subject: unbreak allmodconfig KCONFIG_ALLCONFIG=... + +From: Al Viro + +commit 6b87b70c5339f30e3c5b32085e69625906513dc2 upstream. + + Prior to 3.13 make allmodconfig KCONFIG_ALLCONFIG=/dev/null used +to be equivalent to make allmodconfig; these days it hardwires MODULES to n. +In fact, any KCONFIG_ALLCONFIG that doesn't set MODULES explicitly is +treated as if it set it to n. + + Regression had been introduced by commit cfa98f ("kconfig: do not +override symbols already set"); what happens is that conf_read_simple() +does sym_calc_value(modules_sym) on exit, which leaves SYMBOL_VALID set and +has conf_set_all_new_symbols() skip modules_sym. + + It's pretty easy to fix - simply move that call of sym_calc_value() +into the callers, except for the ones in KCONFIG_ALLCONFIG handling. +Objections? + +Signed-off-by: Al Viro +Fixes: cfa98f2e0ae9 ("kconfig: do not override symbols already set") +Signed-off-by: Michal Marek +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/kconfig/confdata.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +--- a/scripts/kconfig/confdata.c ++++ b/scripts/kconfig/confdata.c +@@ -267,10 +267,8 @@ int conf_read_simple(const char *name, i + if (in) + goto load; + sym_add_change_count(1); +- if (!sym_defconfig_list) { +- sym_calc_value(modules_sym); ++ if (!sym_defconfig_list) + return 1; +- } + + for_all_defaults(sym_defconfig_list, prop) { + if (expr_calc_value(prop->visible.expr) == no || +@@ -403,7 +401,6 @@ setsym: + } + free(line); + fclose(in); +- sym_calc_value(modules_sym); + return 0; + } + +@@ -414,8 +411,12 @@ int conf_read(const char *name) + + sym_set_change_count(0); + +- if (conf_read_simple(name, S_DEF_USER)) ++ if (conf_read_simple(name, S_DEF_USER)) { ++ sym_calc_value(modules_sym); + return 1; ++ } ++ ++ sym_calc_value(modules_sym); + + for_all_symbols(i, sym) { + sym_calc_value(sym); +@@ -846,6 +847,7 @@ static int conf_split_config(void) + + name = conf_get_autoconfig_name(); + conf_read_simple(name, S_DEF_AUTO); ++ sym_calc_value(modules_sym); + + if (chdir("include/config")) + return 1;