scsi: sg: check for valid direction before starting the request
authorJohannes Thumshirn <jthumshirn@suse.de>
Fri, 7 Apr 2017 07:34:15 +0000 (09:34 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 12 Apr 2017 00:55:20 +0000 (20:55 -0400)
commit28676d869bbb5257b5f14c0c95ad3af3a7019dd5
tree01f1d4f07f0e80cf33a3fe346fd95c7a2f779208
parent1bc0eb0446158cc76562176b80623aa119afee5b
scsi: sg: check for valid direction before starting the request

Check for a valid direction before starting the request, otherwise we
risk running into an assertion in the scsi midlayer checking for valid
requests.

[mkp: fixed typo]

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Link: http://www.spinics.net/lists/linux-scsi/msg104400.html
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Hannes Reinecke <hare@suse.com>
Tested-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sg.c