[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140530.152721.2164470954070022673.davem@davemloft.net>
Date: Fri, 30 May 2014 15:27:21 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: rajesh.borundia@...gic.com
Cc: netdev@...r.kernel.org, Dept-HSGLinuxNICDev@...gic.com
Subject: Re: [PATCH net] qlcnic: Initialize mailbox cmd structure to zero.
From: Rajesh Borundia <rajesh.borundia@...gic.com>
Date: Sun, 25 May 2014 10:55:02 -0400
> o Uninitialized fields in mailbox command structure
> caused commands to time out randomly due to garbage
> values, so initialize it to zero.
>
> Signed-off-by: Rajesh Borundia <rajesh.borundia@...gic.com>
The reason you ran into this problem is that some callers clear out
the command structure, and some do not.
And after your change it's even more confusing, because it is not
clear at all who is responsible for this initialization.
In my opinion it is better to have the place that allocates the
memory perform the initialization. This means for interfaces that
take on-stack references from their caller, the caller does it.
This also avoids situations (which currently isn't happening here)
where error codes cause early function exits and as a result the
passed in variable isn't cleared out.
It also makes it so that the compiler can %100 see that the entire
object is initialized before being used, in all code paths.
Therefore, please change this bug fix to instead add the appropriate
memset()'s to qlcnic_sriov_get_vf_acl(), qlcnic_sriov_channel_cfg_cmd(),
and qlcnic_sriov_cfg_vf_guest_vlan().
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists