scsi: sg: Change next_cmd_len handling to mirror upstream
authorBen Hutchings <ben@decadent.org.uk>
Thu, 28 May 2020 17:54:25 +0000 (18:54 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 11 Jun 2020 18:05:43 +0000 (19:05 +0100)
commitf4c55b72c7d3d87945acdee027d7b07cdbc2f8b7
tree573b41927e8fcece2823ba4c39394421fcb36873
parentfc23502b1025b597c6cf4b479b52a466724944a1
scsi: sg: Change next_cmd_len handling to mirror upstream

Change the type of next_cmd_len to unsigned char, done in upstream
commit 65c26a0f3969 "sg: relax 16 byte cdb restriction".

Move the range check from sg_write() to sg_ioctl(), which was done by
that commit and commit bf33f87dd04c "scsi: sg: check length passed to
SG_NEXT_CMD_LEN".  Continue limiting the command length to
MAX_COMMAND_SIZE (16).

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/scsi/sg.c