enic: fix return value in _vnic_dev_cmd
authorGovindarajulu Varadarajan <_govind@gmx.com>
Mon, 23 Jun 2014 10:37:59 +0000 (16:07 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Jun 2014 21:32:19 +0000 (14:32 -0700)
Hardware (in readq(&devcmd->args[0])) returns positive number in case of error.
But _vnic_dev_cmd should return a negative value in case of error.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cisco/enic/vnic_dev.c

index e86a45cb9e682980b25e5f6ebfe1772afb3a377b..263081b8e6366dc25825d646c09fbec25874e51f 100644 (file)
@@ -312,12 +312,12 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
                                err = (int)readq(&devcmd->args[0]);
                                if (err == ERR_EINVAL &&
                                    cmd == CMD_CAPABILITY)
-                                       return err;
+                                       return -err;
                                if (err != ERR_ECMDUNKNOWN ||
                                    cmd != CMD_CAPABILITY)
                                        pr_err("Error %d devcmd %d\n",
                                                err, _CMD_N(cmd));
-                               return err;
+                               return -err;
                        }
 
                        if (_CMD_DIR(cmd) & _CMD_DIR_READ) {