public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>,
	support@lsi.com, DL-MPTFusionLinux@lsi.com,
	linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] [SCSI] mpt fusion: declare some sizes as unsigned
Date: Fri, 1 Nov 2013 13:24:10 +0300	[thread overview]
Message-ID: <20131101102410.GD29795@longonot.mountain> (raw)

In mptctl_do_mpt_command() we cap the upper bound of .maxSenseBytes but
we don't check for negative values:

	if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE)

I've fixed this by making the type unsigned and I changed the
surrounding types to match as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/message/fusion/mptctl.h b/drivers/message/fusion/mptctl.h
index d564cc9..9ea5a18 100644
--- a/drivers/message/fusion/mptctl.h
+++ b/drivers/message/fusion/mptctl.h
@@ -324,11 +324,11 @@ struct mpt_ioctl_command {
 	char		__user *dataInBufPtr;
 	char		__user *dataOutBufPtr;
 	char		__user *senseDataPtr;
-	int		maxReplyBytes;
-	int		dataInSize;
-	int		dataOutSize;
-	int		maxSenseBytes;
-	int		dataSgeOffset;
+	u32		maxReplyBytes;
+	u32		dataInSize;
+	u32		dataOutSize;
+	u32		maxSenseBytes;
+	u32		dataSgeOffset;
 	char		MF[1];
 };
 
@@ -343,11 +343,11 @@ struct mpt_ioctl_command32 {
 	u32	dataInBufPtr;
 	u32	dataOutBufPtr;
 	u32	senseDataPtr;
-	int	maxReplyBytes;
-	int	dataInSize;
-	int	dataOutSize;
-	int	maxSenseBytes;
-	int	dataSgeOffset;
+	u32	maxReplyBytes;
+	u32	dataInSize;
+	u32	dataOutSize;
+	u32	maxSenseBytes;
+	u32	dataSgeOffset;
 	char	MF[1];
 };
 #endif	/*}*/

                 reply	other threads:[~2013-11-01 10:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20131101102410.GD29795@longonot.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=DL-MPTFusionLinux@lsi.com \
    --cc=Nagalakshmi.Nandigama@lsi.com \
    --cc=Sreekanth.Reddy@lsi.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=support@lsi.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