From: vikas.chaudhary@qlogic.com
To: jbottomley@parallels.com, michaelc@cs.wisc.edu
Cc: linux-scsi@vger.kernel.org, vikas.chaudhary@qlogic.com,
lalit.chandivade@qlogic.com, ravi.anand@qlogic.com,
Nilesh Javali <nilesh.javali@qlogic.com>
Subject: [PATCH 2/3] qla4xxx: Correct the validation to check in get_sys_info mailbox
Date: Sat, 29 Dec 2012 02:24:53 -0500 [thread overview]
Message-ID: <1356765894-14001-3-git-send-email-vikas.chaudhary@qlogic.com> (raw)
In-Reply-To: <1356765894-14001-1-git-send-email-vikas.chaudhary@qlogic.com>
From: Nilesh Javali <nilesh.javali@qlogic.com>
Check mbox_sts[3] instead of mbox_sts[4] for ISP83xx to validate size
of data returned
Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_nx.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 491668d..b3d6dab 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -3427,11 +3427,11 @@ int qla4_8xxx_get_sys_info(struct scsi_qla_host *ha)
}
/* Make sure we receive the minimum required data to cache internally */
- if (mbox_sts[4] < offsetof(struct mbx_sys_info, reserved)) {
+ if ((is_qla8032(ha) ? mbox_sts[3] : mbox_sts[4]) <
+ offsetof(struct mbx_sys_info, reserved)) {
DEBUG2(printk("scsi%ld: %s: GET_SYS_INFO data receive"
" error (%x)\n", ha->host_no, __func__, mbox_sts[4]));
goto exit_validate_mac82;
-
}
/* Save M.A.C. address & serial_number */
--
1.7.8.GIT
next prev parent reply other threads:[~2012-12-29 7:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-29 7:24 [PATCH 0/3] qla4xxx: Updates for scsi "misc" branch vikas.chaudhary
2012-12-29 7:24 ` [PATCH 1/3] qla4xxx: Pass correct function param to qla4_8xxx_rd_direct vikas.chaudhary
2012-12-29 7:24 ` vikas.chaudhary [this message]
2012-12-29 7:24 ` [PATCH 3/3] qla4xxx: Update driver version to 5.03.00-k3 vikas.chaudhary
2013-01-08 6:12 ` [PATCH 0/3] qla4xxx: Updates for scsi "misc" branch Mike Christie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356765894-14001-3-git-send-email-vikas.chaudhary@qlogic.com \
--to=vikas.chaudhary@qlogic.com \
--cc=jbottomley@parallels.com \
--cc=lalit.chandivade@qlogic.com \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=nilesh.javali@qlogic.com \
--cc=ravi.anand@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).