From: Christoph Hellwig Date: Tue, 3 Oct 2017 10:48:41 +0000 (+0200) Subject: scsi: scsi_transport_sas: check reply payload length instead of bidi request X-Git-Tag: v4.15-rc1~125^2~111 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=07f5d563c6e52068cbfcd97ed79f5bb1b1d33067;p=linux-block.git scsi: scsi_transport_sas: check reply payload length instead of bidi request As a user of bsg-lib the SAS transport should not poke into request internals but use the bsg_job fields instead. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 319dff970237..736a1f4f9676 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -177,7 +177,7 @@ static int sas_smp_dispatch(struct bsg_job *job) if (!scsi_is_host_device(job->dev)) rphy = dev_to_rphy(job->dev); - if (!job->req->next_rq) { + if (!job->reply_payload.payload_len) { dev_warn(job->dev, "space for a smp response is missing\n"); bsg_job_done(job, -EINVAL, 0); return 0;