scsi: don't allow setting of queue_depth bigger than can_queue
[firefly-linux-kernel-4.4.55.git] / drivers / scsi / megaraid / megaraid_mbox.c
index 6b077d839f2bf4c32de70ea3d98b44c6417edcd8..d56eb9d3d40ca1e8c1f1c8d6620224664669395b 100644 (file)
@@ -347,8 +347,6 @@ static int megaraid_change_queue_depth(struct scsi_device *sdev, int qdepth,
        if (reason != SCSI_QDEPTH_DEFAULT)
                return -EOPNOTSUPP;
 
-       if (qdepth > MBOX_MAX_SCSI_CMDS)
-               qdepth = MBOX_MAX_SCSI_CMDS;
        scsi_adjust_queue_depth(sdev, qdepth);
        return sdev->queue_depth;
 }