mpt fusion: declare some sizes as unsigned
Subsystems (3)
PATCH 1/1 mpt fusion: declare some sizes as unsigned
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 <[email protected]>
drivers/message/fusion/mptctl.h +10 -10
@@ -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 /*}*/