Commit:     20235f35221472f1a127a5d5414f11091eb0a845
Parent:     0272bf7271eb6895b081c3df34c3ebe50cb769b7
Author:     Salyzyn, Mark <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 21 13:22:56 2007 -0400
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Wed Mar 21 11:45:15 2007 -0600

    [SCSI] aacraid: check buffer address in aac_internal_transfer
    Captured a panic on an older kernel where an application issuing
    commands via sg was sending requests that lacked a request_buffer, thus
    the buffer pointer used in aac_internal_transer was NULL. The
    application was fixed closing the issue, but felt it was advised to
    immunize the driver against the eventuality.
    Signed-off-by: Mark Salyzyn <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
 drivers/scsi/aacraid/aachba.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 0c4e27e..f9deab6 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -350,8 +350,9 @@ static void aac_internal_transfer(struct scsi_cmnd 
*scsicmd, void *data, unsigne
                buf = scsicmd->request_buffer;
                transfer_len = min(scsicmd->request_bufflen, len + offset);
-       memcpy(buf + offset, data, transfer_len - offset);
+       transfer_len -= offset;
+       if (buf && transfer_len)
+               memcpy(buf + offset, data, transfer_len);
        if (scsicmd->use_sg) 
                kunmap_atomic(buf - sg->offset, KM_IRQ0);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to