aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGovindarajulu Varadarajan <gvaradar@cisco.com>2018-06-18 13:01:05 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-19 19:10:13 -0400
commit56f772279a762984f6e9ebbf24a7c829faba5712 (patch)
treef9a2fc742b0482d6acbb7828e1b8b8ec6dd7cf29
parent8c43bd1706885ba1acfa88da02bc60a2ec16f68c (diff)
enic: do not overwrite error code
In failure path, we overwrite err to what vnic_rq_disable() returns. In case it returns 0, enic_open() returns success in case of error. Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Fixes: e8588e268509 ("enic: enable rq before updating rq descriptors") Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cisco/enic/enic_main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index e6ad581eadd8..90c645b8538e 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1920,7 +1920,7 @@ static int enic_open(struct net_device *netdev)
1920{ 1920{
1921 struct enic *enic = netdev_priv(netdev); 1921 struct enic *enic = netdev_priv(netdev);
1922 unsigned int i; 1922 unsigned int i;
1923 int err; 1923 int err, ret;
1924 1924
1925 err = enic_request_intr(enic); 1925 err = enic_request_intr(enic);
1926 if (err) { 1926 if (err) {
@@ -1977,10 +1977,9 @@ static int enic_open(struct net_device *netdev)
1977 1977
1978err_out_free_rq: 1978err_out_free_rq:
1979 for (i = 0; i < enic->rq_count; i++) { 1979 for (i = 0; i < enic->rq_count; i++) {
1980 err = vnic_rq_disable(&enic->rq[i]); 1980 ret = vnic_rq_disable(&enic->rq[i]);
1981 if (err) 1981 if (!ret)
1982 return err; 1982 vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);
1983 vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);
1984 } 1983 }
1985 enic_dev_notify_unset(enic); 1984 enic_dev_notify_unset(enic);
1986err_out_free_intr: 1985err_out_free_intr: