aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index f02bfcc282e5..ecd16541896b 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -1066,11 +1066,19 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc,
1066{ 1066{
1067 struct iscsi_hdr *hdr = &rx_desc->iscsi_header; 1067 struct iscsi_hdr *hdr = &rx_desc->iscsi_header;
1068 struct iscsi_conn *conn = isert_conn->conn; 1068 struct iscsi_conn *conn = isert_conn->conn;
1069 struct iscsi_session *sess = conn->sess;
1069 struct iscsi_cmd *cmd; 1070 struct iscsi_cmd *cmd;
1070 struct isert_cmd *isert_cmd; 1071 struct isert_cmd *isert_cmd;
1071 int ret = -EINVAL; 1072 int ret = -EINVAL;
1072 u8 opcode = (hdr->opcode & ISCSI_OPCODE_MASK); 1073 u8 opcode = (hdr->opcode & ISCSI_OPCODE_MASK);
1073 1074
1075 if (sess->sess_ops->SessionType &&
1076 (!(opcode & ISCSI_OP_TEXT) || !(opcode & ISCSI_OP_LOGOUT))) {
1077 pr_err("Got illegal opcode: 0x%02x in SessionType=Discovery,"
1078 " ignoring\n", opcode);
1079 return 0;
1080 }
1081
1074 switch (opcode) { 1082 switch (opcode) {
1075 case ISCSI_OP_SCSI_CMD: 1083 case ISCSI_OP_SCSI_CMD:
1076 cmd = iscsit_allocate_cmd(conn, GFP_KERNEL); 1084 cmd = iscsit_allocate_cmd(conn, GFP_KERNEL);