Skip to contentSkip to conversation

Patch "megaraid_sas: add missing curly braces in ioctl handler" has been added to the 4.5-stable tree

PATCH [email protected] 1 participant 1 message May 2, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

megaraid_sas: add missing curly braces in ioctl handler

to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 3deb9438d34a09f6796639b652a01d110aca9f75 Mon Sep 17 00:00:00 2001

From: Arnd Bergmann <[email protected]>
Date: Mon, 14 Mar 2016 15:29:45 +0100
Subject: megaraid_sas: add missing curly braces in ioctl handler

From: Arnd Bergmann <[email protected]>

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.

Fixes 90dc9d98f01b ("megaraid_sas : MFI MPT linked list corruption fix")
---
 drivers/scsi/megaraid/megaraid_sas_base.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +2 -1
@@ -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);

Patches currently in stable-queue which might be from [email protected] are

queue-4.5/misc-bmp085-enable-building-as-a-module.patch queue-4.5/xen-kconfig-don-t-select-input_xen_kbddev_frontend.patch queue-4.5/arm-exynos-select-thermal_of.patch queue-4.5/regulator-s5m8767-fix-get_register-error-handling.patch queue-4.5/asm-generic-futex-re-enable-preemption-in-futex_atomic_cmpxchg_inatomic.patch queue-4.5/ntb-perf-test-fix-address-space-confusion.patch queue-4.5/paride-make-verbose-parameter-an-int-again.patch queue-4.5/arm-prima2-always-enable-reset-controller.patch queue-4.5/asoc-s3c24xx-use-const-snd_soc_component_driver-pointer.patch queue-4.5/scsi_dh-force-modular-build-if-scsi-is-a-module.patch queue-4.5/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch