qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH] spapr_vscsi: Set uninitialized variable


From: Alexander Graf
Subject: [Qemu-devel] Re: [PATCH] spapr_vscsi: Set uninitialized variable
Date: Tue, 5 Apr 2011 09:55:51 +0200

On 05.04.2011, at 07:04, Benjamin Herrenschmidt wrote:

> 
> On Tue, 2011-04-05 at 14:14 +1000, David Gibson wrote:
>>>> @@ -255,7 +255,7 @@ static int vscsi_srp_direct_data(VSCSIState *s,
>> vscsi_req *req,
>>>> {
>>>>     struct srp_direct_buf *md = req->cur_desc;
>>>>     uint32_t llen;
>>>> -    int rc;
>>>> +    int rc = 0;
>>> 
>>> David, is this correct? Or would rc be -1 when !llen?
>> 
>> I talked to Ben, who wrote this code - apparently his mail server blew
>> up.  This patch should be correct, AFAWCT.  It's not totally clear
>> what the right return value should be in thie case, or indeed that
>> this case ever actually happens, but we think 0 is right. 
> 
> Just double checked and we never call that function if len is 0

That's probably the reason gcc didn't complain before. So I'll just take 
Stefan's patch.


Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]