cnic: Add missing error checking for RAMROD_CMD_ID_CLOSE
authorEddie Wai <eddie.wai@broadcom.com>
Mon, 29 Jul 2013 02:03:59 +0000 (19:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Jul 2013 05:03:07 +0000 (22:03 -0700)
Completion status field should also be checked for non-zero error
condition.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/cnic.c

index 24f2a0970a6487b31cef7a68b379714f7323d51e..07ec4cec0866794ac92645d7ba2c4f5c78a5ba66 100644 (file)
@@ -4022,15 +4022,18 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
                cnic_cm_upcall(cp, csk, opcode);
                break;
 
-       case L5CM_RAMROD_CMD_ID_CLOSE:
-               if (l4kcqe->status != 0) {
-                       netdev_warn(dev->netdev, "RAMROD CLOSE compl with "
-                                   "status 0x%x\n", l4kcqe->status);
+       case L5CM_RAMROD_CMD_ID_CLOSE: {
+               struct iscsi_kcqe *l5kcqe = (struct iscsi_kcqe *) kcqe;
+
+               if (l4kcqe->status != 0 || l5kcqe->completion_status != 0) {
+                       netdev_warn(dev->netdev, "RAMROD CLOSE compl with status 0x%x completion status 0x%x\n",
+                                   l4kcqe->status, l5kcqe->completion_status);
                        opcode = L4_KCQE_OPCODE_VALUE_CLOSE_COMP;
                        /* Fall through */
                } else {
                        break;
                }
+       }
        case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED:
        case L4_KCQE_OPCODE_VALUE_CLOSE_COMP:
        case L4_KCQE_OPCODE_VALUE_RESET_COMP: