Commit 56f77227 authored by Govindarajulu Varadarajan's avatar Govindarajulu Varadarajan Committed by David S. Miller

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: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Fixes: e8588e26 ("enic: enable rq before updating rq descriptors")
Signed-off-by: default avatarGovindarajulu Varadarajan <gvaradar@cisco.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8c43bd17
...@@ -1920,7 +1920,7 @@ static int enic_open(struct net_device *netdev) ...@@ -1920,7 +1920,7 @@ static int enic_open(struct net_device *netdev)
{ {
struct enic *enic = netdev_priv(netdev); struct enic *enic = netdev_priv(netdev);
unsigned int i; unsigned int i;
int err; int err, ret;
err = enic_request_intr(enic); err = enic_request_intr(enic);
if (err) { if (err) {
...@@ -1977,10 +1977,9 @@ static int enic_open(struct net_device *netdev) ...@@ -1977,10 +1977,9 @@ static int enic_open(struct net_device *netdev)
err_out_free_rq: err_out_free_rq:
for (i = 0; i < enic->rq_count; i++) { for (i = 0; i < enic->rq_count; i++) {
err = vnic_rq_disable(&enic->rq[i]); ret = vnic_rq_disable(&enic->rq[i]);
if (err) if (!ret)
return err; vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);
vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);
} }
enic_dev_notify_unset(enic); enic_dev_notify_unset(enic);
err_out_free_intr: err_out_free_intr:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment