From 427cb859b812ffe8941ecb3b0a210b1e1c5116c4 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Tue, 25 Mar 2014 12:01:29 +0000 Subject: when working with the cdb its better to use cmdlen than datalen. ok jmatthew@ --- sys/dev/pci/qle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index c40f9109a07..4a06d935d7e 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.17 2014/03/25 07:15:52 dlg Exp $ */ +/* $OpenBSD: qle.c,v 1.18 2014/03/25 12:01:28 dlg Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew @@ -2388,7 +2388,7 @@ qle_put_cmd(struct qle_softc *sc, void *buf, struct scsi_xfer *xs, if (xs->cmdlen > 16) { htolem16(&req->req_fcp_cmnd_len, 12 + xs->cmdlen + 4); cmnd->fcp_add_cdb_len = xs->cmdlen - 16; - memcpy(cmnd->fcp_cdb + xs->datalen, &fcp_dl, sizeof(fcp_dl)); + memcpy(cmnd->fcp_cdb + xs->cmdlen, &fcp_dl, sizeof(fcp_dl)); } else { htolem16(&req->req_fcp_cmnd_len, 12 + 16 + 4); cmnd->fcp_add_cdb_len = 0; -- cgit v1.2.3