Patch "IB/ehca: fix maybe-uninitialized warnings" has been added to the 3.18-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    IB/ehca: fix maybe-uninitialized warnings

to the 3.18-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:
     ib-ehca-fix-maybe-uninitialized-warnings.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From arnd@xxxxxxxx  Thu May  4 15:31:46 2017
From: Arnd Bergmann <arnd@xxxxxxxx>
Date: Thu,  4 May 2017 22:52:03 +0200
Subject: IB/ehca: fix maybe-uninitialized warnings
To: gregkh@xxxxxxxxxxxxxxxxxxx
Cc: stable@xxxxxxxxxxxxxxx, Arnd Bergmann <arnd@xxxxxxxx>
Message-ID: <20170504205209.498721-8-arnd@xxxxxxxx>

From: Arnd Bergmann <arnd@xxxxxxxx>

The driver causes two warnings about possibly uninitialized variables:

drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_set_pagebuf':
drivers/infiniband/hw/ehca/ehca_mrmw.c:1908:4: warning: 'prev_pgaddr' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/infiniband/hw/ehca/ehca_mrmw.c:1924:14: note: 'prev_pgaddr' was declared here
drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_reg_mr':
drivers/infiniband/hw/ehca/ehca_mrmw.c:2430:5: warning: 'hret' may be used uninitialized in this function [-Wmaybe-uninitialized]

The first one is definitely a false positive, the second one may or may not
be one. In both cases, adding an intialization is the safe and easy
workaround.

The driver was removed in mainline in commit e581d111dad3
("staging/rdma: remove deprecated ehca driver"), in linux-4.6.
In 4.4, the file is located in drivers/staging/rdma/ehca/ehca_mrmw.c,
and the fix still applies.

Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/infiniband/hw/ehca/ehca_mrmw.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/infiniband/hw/ehca/ehca_mrmw.c
+++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c
@@ -1921,7 +1921,7 @@ static int ehca_set_pagebuf_user2(struct
 				  u64 *kpage)
 {
 	int ret = 0;
-	u64 pgaddr, prev_pgaddr;
+	u64 pgaddr, prev_pgaddr = 0;
 	u32 j = 0;
 	int kpages_per_hwpage = pginfo->hwpage_size / PAGE_SIZE;
 	int nr_kpages = kpages_per_hwpage;
@@ -2417,6 +2417,7 @@ static int ehca_reg_bmap_mr_rpages(struc
 		ehca_err(&shca->ib_device, "kpage alloc failed");
 		return -ENOMEM;
 	}
+	hret = H_SUCCESS;
 	for (top = 0; top < EHCA_MAP_ENTRIES; top++) {
 		if (!ehca_bmap_valid(ehca_bmap->top[top]))
 			continue;


Patches currently in stable-queue which might be from arnd@xxxxxxxx are

queue-3.18/ib-iser-fix-sparse-warnings.patch
queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch
queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch
queue-3.18/arm64-build-vdso-without-libgcov.patch
queue-3.18/arm64-provide-a-namespace-to-ncaps.patch
queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch
queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch
queue-3.18/tty-isicom-fix-big-endian-compile-warning.patch
queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch
queue-3.18/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch
queue-3.18/ips-remove-pointless-warning.patch
queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch
queue-3.18/staging-imx-drm-fix-indentation-warning.patch
queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch
queue-3.18/mm-cma-silence-warnings-due-to-max-usage.patch
queue-3.18/misdn-avoid-arch-specific-__builtin_return_address-call.patch
queue-3.18/staging-bcm-add-32-bit-host-dependency.patch
queue-3.18/staging-vt6655-fix-overly-large-stack-usage.patch
queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch
queue-3.18/infiniband-mlx5-avoid-a-compile-time-warning.patch
queue-3.18/arm-cns3xxx-shut-up-frame-size-warning.patch
queue-3.18/ib-ehca-fix-maybe-uninitialized-warnings.patch



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]