 +
 +		default:
 +			dev_err(gpu->dev, "%s: op %s (%u) not permitted at offset %u\n",
++					__func__, opcode_to_str(op), op, buf - start);
++			return false;
++		}
++
++		if (len < 0) {
++			dev_err(gpu->dev, "%s: op %s (%u) at offset %u is not valid\n",
 +					__func__, opcode_to_str(op), op, buf - start);
 +			return false;
 +		}

 drivers/staging/etnaviv/cmdstream.xml.h       |  218 +++++
 drivers/staging/etnaviv/common.xml.h          |  253 ++++++
 drivers/staging/etnaviv/etnaviv_buffer.c      |  286 +++++++
 drivers/staging/etnaviv/etnaviv_cmd_parser.c  |   99 +++
 drivers/staging/etnaviv/etnaviv_drv.c         |  731 ++++++++++++++++
 drivers/staging/etnaviv/etnaviv_drv.h         |  159 ++++
 drivers/staging/etnaviv/etnaviv_gem.c         |  779 ++++++++++++++++++

 drivers/staging/etnaviv/state.xml.h           |  348 ++++++++
 drivers/staging/etnaviv/state_hi.xml.h        |  405 +++++++++
 include/uapi/drm/etnaviv_drm.h                |  223 +++++
 26 files changed, 6352 insertions(+)
 create mode 100644 drivers/staging/etnaviv/Kconfig
 create mode 100644 drivers/staging/etnaviv/Makefile
 create mode 100644 drivers/staging/etnaviv/cmdstream.xml.h
