2011-03-17 23:04:30

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warning in Linus' tree

Hi all,

After merging the Linus' tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

drivers/infiniband/core/addr.c: In function 'addr4_resolve':
drivers/infiniband/core/addr.c:188: warning: 'ret' may be used uninitialized in this function

I didn't notice this one before, sorry.

I don't know what introduced it, but the third if statement in the
function will make us use "ret" uninitialised.
--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (529.00 B)
(No filename) (490.00 B)
Download all attachments

2011-03-17 23:35:44

by Hefty, Sean

[permalink] [raw]
Subject: [PATCH] rdma/addr: Initialize ret to fix build warning

Commit b23dd4fe42b455af5c6e20966b7d6959fa8352ea (ipv4: Make output
route lookup return rtable directly) resulted in leaving
ret uninitialized, where it may later be returned.

Signed-off-by: Sean Hefty <[email protected]>
---
I didn't actually test this, but it looks correct.

drivers/infiniband/core/addr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index e0ef5fd..4ffc224 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -204,7 +204,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,

/* If the device does ARP internally, return 'done' */
if (rt->dst.dev->flags & IFF_NOARP) {
- rdma_copy_addr(addr, rt->dst.dev, NULL);
+ ret = rdma_copy_addr(addr, rt->dst.dev, NULL);
goto put;
}


2011-03-17 23:56:49

by Roland Dreier

[permalink] [raw]
Subject: Re: [PATCH] rdma/addr: Initialize ret to fix build warning

On Thu, Mar 17, 2011 at 4:35 PM, Hefty, Sean <[email protected]> wrote:
> Commit b23dd4fe42b455af5c6e20966b7d6959fa8352ea (ipv4: Make output
> route lookup return rtable directly) resulted in leaving
> ret uninitialized, where it may later be returned.

Looks good to me, I'll merge this.

2011-03-18 01:11:28

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] rdma/addr: Initialize ret to fix build warning

From: Roland Dreier <[email protected]>
Date: Thu, 17 Mar 2011 16:56:27 -0700

> On Thu, Mar 17, 2011 at 4:35 PM, Hefty, Sean <[email protected]> wrote:
>> Commit b23dd4fe42b455af5c6e20966b7d6959fa8352ea (ipv4: Make output
>> route lookup return rtable directly) resulted in leaving
>> ret uninitialized, where it may later be returned.
>
> Looks good to me, I'll merge this.

Thanks Roland.

Acked-by: David S. Miller <[email protected]>

2011-03-18 01:13:00

by David Miller

[permalink] [raw]
Subject: Re: linux-next: build warning in Linus' tree

From: Stephen Rothwell <[email protected]>
Date: Fri, 18 Mar 2011 10:04:18 +1100

> Hi all,
>
> After merging the Linus' tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> drivers/infiniband/core/addr.c: In function 'addr4_resolve':
> drivers/infiniband/core/addr.c:188: warning: 'ret' may be used uninitialized in this function
>
> I didn't notice this one before, sorry.
>
> I don't know what introduced it, but the third if statement in the
> function will make us use "ret" uninitialised.

It was the ipv4 route lookup interface changes.

Roland has received a fix already, and will merge it via the infiniband
tree.