
896 N.E.2d 327 (2008)
231 Ill.2d 51
Reginald L. BEACHAM, Appellee,
v.
Roger E. WALKER, Jr., Director, Illinois Department of Corrections, Appellant.
No. 104176.
Supreme Court of Illinois.
September 18, 2008.
*329 Lisa Madigan, Attorney General, Springfield (Gary Feinerman, Michael A. Scodro, Solicitors General, Michael M. Glick, and Garson Fischer, Assistant Attorneys General, Chicago, of counsel), for appellant.
Jerold S. Solovy, Richard T. Franch, Spiridoula Mavrothalasitis, of Jenner & Block LLP, Chicago, for appellee, and Reginald L. Beacham, Danville, appellee pro se.

OPINION
Justice KARMEIER delivered the judgment of the court, with opinion:
Plaintiff, Reginald Beacham, an inmate in the Illinois correctional system, filed a pro se complaint for order of habeas corpus,[1] naming Roger Walker, Director of Corrections, as defendant. Pursuant to the defendant's motion to dismiss, plaintiff's pro se complaint was dismissed without prejudice, and was thereafter superceded by an amended complaint filed by appointed counsel. Plaintiff's amended complaint suggested, inter alia, an irregularity in the imposition of his consecutive sentence for attempted murder and alleged that he was, consequently, unlawfully detained, as his initial sentence for murder would have expired if day-for-day good time were applied. The defendant moved to dismiss plaintiff's complaint pursuant to section 2-615 of the Code of Civil Procedure (Code) (735 ILCS 5/2-615 (West 2004)). The defendant interpreted plaintiff's allegations as suggesting that his 30-year, consecutive sentence for attempted murder was void and argued that plaintiff was not entitled to immediate release in any event, because good-time credits cannot be considered in a habeas proceeding. The circuit court granted defendant's motion. The appellate court reversed and remanded, finding "[i]f plaintiff's claim that his 30-year sentence is void is meritorious and if DOC determines day-for-day good-conduct credit applies, he would be entitled to immediate release from prison." No. 4-06-0269 (unpublished order under Supreme Court Rule 23). This court allowed defendant's petition for leave to appeal (210 Ill.2d R. 315), and we now reverse the judgment of the appellate court.

BACKGROUND
Plaintiff's amended complaint recounts the facts leading up to the filing of plaintiff's current habeas complaint. In Cook County case number 86-CR-7507, plaintiff was found guilty of the murder of Will James (counts I and II) and the attempted murder of Frank James (count III). He was sentenced to 40 years in prison for each of two counts of murder to be served concurrently, and to 30 years for one count of attempted murder to be served consecutively with the sentences for murder. As plaintiff notes, the State's evidence indicated that plaintiff first shot and injured Frank James, then shot and killed Will James when he and another man attempted to restrain plaintiff. Plaintiff's convictions *330 were affirmed on direct appeal. People v. Beacham, 189 Ill.App.3d 483, 136 Ill.Dec. 868, 545 N.E.2d 392 (1989). Plaintiff's amended complaint indicates that he has filed at least two prior complaints for habeas relief under state statutory provisions. Both were denied. A federal habeas complaint has been dismissed.
The current habeas proceedings were commenced on November 4, 2004, with the filing of a pro se complaint for habeas relief. Plaintiff's pro se complaint set forth an ill-defined one-act, one-crime argument, suggesting that one of his sentences is void, and averred that he would be entitled to release from custody if day-for-day good time were applied. Defendant responded with a motion to dismiss and a supporting memorandum of law, arguing that plaintiff had failed to attach relevant documents to his complaint, that plaintiff had failed to state a claim upon which relief could be granted, and that the Department of Corrections had correctly calculated plaintiff's term of imprisonment, which had not expired. On August 1, 2005, the circuit court entered an order dismissing plaintiff's complaint without prejudice.
On September 22, 2005, plaintiff, who was then represented by appointed counsel, filed an amended complaint for order of habeas corpus, alleging that the time during which he could be legally detained had expired. Plaintiff suggested there was a one-act, one-crime violation with respect to his two murder convictions, but acknowledged: "It may be argued that this sentence [sic] of 40 years on count I and count II are harmless because the sentences are to be served concurrently." The gist of plaintiff's argument appears to have centered around the consecutive sentence he received for attempted murder, although his argument  if it can be called such  is more inferential than assertive. Plaintiff merely observes that section 1005-8-4(a) of the Unified Code of Corrections (Ill.Rev.Stat.1987, ch. 38, par. 1005-8-4(a), now 730 ILCS 5/5-8-4(a) (West 2004)) mandates concurrent sentences unless the sentencing court is of the opinion that a consecutive sentence is required to protect the public from further criminal conduct, in which case such a finding is to be "set forth in the record." Plaintiff then notes that no such finding was made of record in this case. Having made that observation, the plaintiff reiterates that his detention is unlawful and he should be released.
The defendant again filed a motion to dismiss pursuant to section 2-615 of the Code. The defendant characterized plaintiff's argument as follows: "Plaintiff generally argues that his attempt murder sentence is void, and that therefore, he is entitled to immediate release under Illinois's mandatory sentencing guidelines once day-for-day good conduct credits are considered." Citing this court's decision in People v. Gosier, 205 Ill.2d 198, 275 Ill. Dec. 493, 792 N.E.2d 1266 (2001), defendant noted that habeas relief is available in only two situations: "the court of conviction lacked subject matter or personal jurisdiction, * * * or some event subsequent to the prisoner's conviction entitles him to immediate release from custody." Defendant stated that plaintiff had not argued that the circuit court "lacked jurisdiction over him or his case" and thus he had failed "to allege a cause of action challenging the jurisdiction of the circuit court." Further, defendant averred that no event had occurred subsequent to conviction that would entitle plaintiff to immediate release from his place of confinement in that plaintiff had not served his maximum sentence. Defendant took the position that good-conduct credits could not be considered in that calculation, citing Taylor v. Cowan, 339 Ill.App.3d 406, 274 Ill.Dec. 124, 790 N.E.2d *331 897 (2003). Thus, the defendant argued, "[e]ven accepting as true plaintiff's allegation that only his 40-year sentence for murder is not void, plaintiff is still not entitled to habeas relief."
Plaintiff filed a handwritten "response" that initially purports to be filed "by his court appointed counsel," but is later acknowledged to be a pro se filing. Plaintiff's response was rambling and often unintelligible, but generally appeared to echo arguments made in his dismissed pro se complaint.
In a docket entry dated March 6, 2006, the circuit court granted the defendant's motion to dismiss, finding that "plaintiff has not shown he is entitled to immediate relief."
On March 16, 2006, plaintiff filed a pro se motion to reconsider, arguing, inter alia, that defendant had admitted his consecutive sentence was void for lack of statutory compliance, and day-for-day good-conduct credit should be considered in determining whether he was entitled to immediate release. Plaintiff's motion was denied. Plaintiff filed timely notice of appeal on March 28, 2006.
The appellate court reversed the dismissal of plaintiff's complaint and remanded with directions to consider the merits of plaintiff's void-sentence argument. The appellate court determined that day-for-day good-conduct credits could be considered in determining plaintiff's entitlement to release and concluded: "If plaintiff's claim that his 30-year sentence is void is meritorious and if DOC determines day-for-day good-conduct credit applies, he would be entitled to immediate release from prison."

ANALYSIS
We are called upon to review the circuit court's ruling on a section 2-615 motion to dismiss. A section 2-615 motion to dismiss challenges the legal sufficiency of a complaint based on defects apparent on its face. Marshall v. Burger King Corp., 222 Ill.2d 422, 429, 305 Ill.Dec. 897, 856 N.E.2d 1048 (2006); City of Chicago v. Beretta U.S.A. Corp., 213 Ill.2d 351, 364, 290 Ill.Dec. 525, 821 N.E.2d 1099 (2004). We review de novo an order granting or denying a section 2-615 motion (Marshall, 222 Ill.2d at 429, 305 Ill.Dec. 897, 856 N.E.2d 1048; Wakulich v. Mraz, 203 Ill.2d 223, 228, 271 Ill.Dec. 649, 785 N.E.2d 843 (2003)), accepting as true all well-pleaded facts and all reasonable inferences that may be drawn from those facts (Marshall, 222 Ill.2d at 429, 305 Ill.Dec. 897, 856 N.E.2d 1048; Ferguson v. City of Chicago, 213 Ill.2d 94, 96-97, 289 Ill.Dec. 679, 820 N.E.2d 455 (2004)). We construe the allegations in the complaint in the light most favorable to the plaintiff. Marshall, 222 Ill.2d at 429, 305 Ill.Dec. 897, 856 N.E.2d 1048; King v. First Capital Financial Services Corp., 215 Ill.2d 1, 11-12, 293 Ill.Dec. 657, 828 N.E.2d 1155 (2005). Given these standards, a cause of action should not be dismissed, pursuant to a section 2-615 motion, unless it is clearly apparent that no set of facts can be proved that would entitle the plaintiff to relief. Marshall, 222 Ill.2d at 429, 305 Ill.Dec. 897, 856 N.E.2d 1048; Canel v. Topinka, 212 Ill.2d 311, 318, 288 Ill.Dec. 623, 818 N.E.2d 311 (2004). However, the plaintiff must allege facts sufficient to bring a claim within a legally recognized cause of action. Marshall, 222 Ill.2d at 429-30, 305 Ill.Dec. 897, 856 N.E.2d 1048.
Habeas corpus provides relief only on the grounds specified in section 10-124 of the Code of Civil Procedure (735 ILCS 5/10-124 (West 1996)). Gosier, 205 Ill.2d at 205, 275 Ill.Dec. 493, 792 N.E.2d 1266; Barney v. Prisoner Review Board, 184 Ill.2d 428, 430, 235 Ill.Dec. 1, 704 *332 N.E.2d 350 (1998). It is well established that an order of habeas corpus is available only to obtain the release of a prisoner who has been incarcerated under a judgment of a court that lacked jurisdiction of the subject matter or the person of the petitioner, or where there has been some occurrence subsequent to the prisoner's conviction that entitles him to release. Gosier, 205 Ill.2d at 205, 275 Ill.Dec. 493, 792 N.E.2d 1266; Barney, 184 Ill.2d at 430, 235 Ill.Dec. 1, 704 N.E.2d 350. A complaint for order of habeas corpus may not be used to review proceedings that do not exhibit one of these defects, even though the alleged error involves a denial of constitutional rights. Gosier, 205 Ill.2d at 205, 275 Ill.Dec. 493, 792 N.E.2d 1266; Barney, 184 Ill.2d at 430, 235 Ill.Dec. 1, 704 N.E.2d 350. Although a void order or judgment may be attacked "at any time or in any court, either directly or collaterally" (People v. Thompson, 209 Ill.2d 19, 27, 282 Ill.Dec. 183, 805 N.E.2d 1200 (2004)), including a habeas proceeding (see People ex rel. Lewis v. Frye, 42 Ill.2d 311, 312, 247 N.E.2d 410 (1969); People v. Brazee, 316 Ill.App.3d 1230, 1234, 250 Ill.Dec. 430, 738 N.E.2d 646 (2000)), the remedy of habeas corpus is not available to review errors which only render a judgment voidable and are of a nonjurisdictional nature. Frye, 42 Ill.2d at 313, 247 N.E.2d 410.
As this court recently noted in Hennings v. Chandler, 229 Ill.2d 18, 322 Ill.Dec. 1, 890 N.E.2d 920 (2008), quoting from People ex rel. Stead v. Superior Court, 234 Ill. 186, 198, 84 N.E. 875 (1908), "`The writ [of habeas corpus] should never issue unless a petition is presented which is in substantial accord and compliance with the provisions of the statute, and which shows upon its face that the petitioner is entitled to his discharge.'" Hennings, 229 Ill.2d at 28, 322 Ill.Dec. 1, 890 N.E.2d 920. "[I]f it is clear from a review of the complaint, that the plaintiff is not entitled to the relief of habeas corpus, the order shall be denied." Hennings, 229 Ill.2d at 26, 322 Ill.Dec. 1, 890 N.E.2d 920. In Hennings, this court concluded that circuit courts may, upon determining that a complaint is insufficient on its face to warrant any relief available under article X, properly deny, sua sponte, a complaint for order of habeas corpus. Hennings, 229 Ill.2d at 30, 322 Ill.Dec. 1, 890 N.E.2d 920, quoting People ex rel. Haven v. Macieiski, 38 Ill.2d 396, 398, 231 N.E.2d 433 (1967) (under such circumstances "dismissing the habeas corpus petition was not erroneous").
In this appeal, the parties would have us decide whether good-conduct credits may be considered in determining whether a plaintiff, in a habeas proceeding, is entitled to immediate release from confinement. However, as the appellate court recognized, in order to succeed in his bid for habeas relief, the plaintiff must first demonstrate that his consecutive sentence is void. If that prerequisite is not established, then plaintiff's good-conduct credits are irrelevant. What the appellate court did not recognize is that the facts alleged in plaintiff's complaint demonstrate he is not entitled to relief. From the face of plaintiff's amended complaint, it is clear that plaintiff's consecutive sentence is not void; therefore, his amended complaint was properly dismissed, and there is no need to reach the credit issue. See People v. Latona, 184 Ill.2d 260, 281, 234 Ill.Dec. 801, 703 N.E.2d 901 (1998) ("A court of review will not ordinarily consider issues that are not essential to the disposition of the cause before it").
A threshold component of plaintiff's argument is that his consecutive sentence was void for lack of statutory compliance insofar as the circuit court failed to "set forth in the record" that a consecutive *333 sentence was required to protect the public from further criminal conduct. However, in People v. Hicks, 101 Ill.2d 366, 374, 78 Ill.Dec. 354, 462 N.E.2d 473 (1984), this court held "that the statutory requirement that the court `shall set forth in the record' the basis for the court's determination that such sentences are `required to protect the public from further criminal conduct by the defendant' is permissive rather than mandatory, and has been waived." If the statutory sentencing requirement of section 5-8-4(b) is subject to forfeiture, as this court held in Hicks, then noncompliance cannot, logically, render the resulting sentence void. "An argument that an order or judgment is void is not subject to waiver." Thompson, 209 Ill.2d at 27, 282 Ill.Dec. 183, 805 N.E.2d 1200. Thus, plaintiff's consecutive sentence would be, at most, voidable. A voidable judgment is not subject to collateral attack. People v. Davis, 156 Ill.2d 149, 157-59, 189 Ill.Dec. 49, 619 N.E.2d 750 (1993). Consequently, the sentencing judge's failure to comply with section 5-8-4(b) would not render plaintiff's consecutive sentence void, and plaintiff is not entitled to habeas relief.
We do not believe that defendant conceded plaintiff's consecutive sentence was void for lack of statutory compliance, as plaintiff suggested in his motion to reconsider, but even if that were the case, we, as a court of review, are not bound by a party's concession. People v. Bywater, 358 Ill.App.3d 191, 195, 294 Ill.Dec. 283, 830 N.E.2d 695 (2005), rev'd on other grounds, 223 Ill.2d 477, 308 Ill.Dec. 424, 861 N.E.2d 989 (2006); People v. Durdin, 312 Ill.App.3d 4, 6, 244 Ill.Dec. 524, 726 N.E.2d 120 (2000); see also People v. Kliner, 185 Ill.2d 81, 116, 235 Ill.Dec. 667, 705 N.E.2d 850 (1998) (reviewing court is not bound by trial court's acceptance of State's erroneous concession). Moreover, this court may affirm the circuit court's judgment on any basis contained in the record. Leonardi v. Loyola University of Chicago, 168 Ill.2d 83, 97, 212 Ill.Dec. 968, 658 N.E.2d 450 (1995) ("As a reviewing court, we can sustain the decision of a lower court on any grounds which are called for by the record, regardless of whether the lower court relied on those grounds and regardless of whether the lower court's reasoning was correct"). Grounds for affirming the decision of the circuit court, dismissing the amended complaint for habeas, are evident from an examination of the record, as the sentencing defect alleged by plaintiff is insufficient to render plaintiff's consecutive sentence void.
In sum, plaintiff's amended complaint  taking into account the applicable case authority  fails to state a basis for habeas corpus relief. Therefore, we reverse the judgment of the appellate court and affirm the circuit court's dismissal of plaintiff's complaint for order of habeas corpus.
Appellate court judgment reversed; circuit court judgment affirmed.
Justices FREEMAN, THOMAS, KILBRIDE, and GARMAN concurred in the judgment and opinion.
Chief Justice FITZGERALD and Justice BURKE took no part in the consideration or decision of this case.
NOTES
[1]  The document filed by plaintiff is actually entitled "Petition for Writ of Habeas Corpus." Article X of the Code of Civil Procedure (735 ILCS 5/10-101 et seq. (West 2004)), which governs habeas proceedings, speaks in terms of a "complaint" for "order" of habeas corpus. The parties variously refer to the document filed as a "complaint" or "petition." For consistency, we adopt the statutory terminology and will utilize the terms "complaint" and "order" herein.
