
838 N.E.2d 969 (2005)
361 Ill. App.3d 803
298 Ill.Dec. 76
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
Freddie TILLER, Defendant-Appellant.
No. 5-04-0127.
Appellate Court of Illinois, Fifth District.
October 20, 2005.
*970 Daniel M. Kirwan, Deputy Defender, Rita K. Peterson, Assistant Defender, Office of the State Appellate Defender, Mt. Vernon, for Appellant.
Robert Haida, State's Attorney, Belleville; Norbert J. Goetten, Director, Stephen E. Norris, Deputy Director, T. David Purcell, Staff Attorney, Office of the State's Attorneys Appellate Prosecutor, Mt. Vernon, for Appellee.
Justice HOPKINS delivered the opinion of the court:
The defendant, Freddie Tiller, appeals from the summary dismissal of his pro se petition for habeas corpus relief pursuant to article VI, section 6, of the Illinois Constitution of 1970 (Ill. Const.1970, art. VI, § 6) and Supreme Court Rules 602, 603, and 606(a) and (b) (134 Ill.2d Rs. 602, 603; 188 Ill.2d Rs. 606(a), (b)). We affirm.

FACTS
In 1979, the defendant was convicted of two counts of murder, two counts of armed violence, and two counts of armed robbery, and he was sentenced to death. The Illinois Supreme Court vacated the death sentences and remanded for resentencing. People v. Tiller, 94 Ill.2d 303, 68 Ill.Dec. 916, 447 N.E.2d 174 (1982). Additionally, the court reversed one armed violence conviction, vacated the other armed violence conviction, and reversed one armed robbery conviction.
On July 27, 1983, the defendant was resentenced to natural-life imprisonment on each of the murder convictions and 30 years' imprisonment on the armed robbery conviction. On appeal, this court reversed the natural-life sentences and remanded for resentencing. People v. Tiller, 130 Ill. App.3d 549, 85 Ill.Dec. 796, 474 N.E.2d 756 (1984).
The defendant was resentenced to two consecutive 40-year terms of imprisonment on the two murder convictions. On August 27, 1987, this court affirmed the defendant's consecutive sentences. People v. Tiller, 158 Ill.App.3d 1106, 121 Ill.Dec. 543, 525 N.E.2d 601 (1987) (unpublished order under Supreme Court Rule 23 (107 Ill.2d R. 23)). Between 1991 and 2000, the defendant filed three postconviction petitions and a habeas corpus petition, all of which the circuit court dismissed. On September 12, 2003, the defendant filed a second habeas corpus petition and an amended habeas corpus petition. On January 8, 2004, the circuit court dismissed the defendant's cause of action. The defendant filed a timely notice of appeal.

ANALYSIS
On appeal, the only issue is whether the circuit court erred in summarily dismissing the defendant's habeas corpus petition. We affirm.
A dispute exists among the districts of this court regarding whether a circuit court may sua sponte summarily dismiss a defendant's postjudgment petition under section 2-1401 of the Illinois Code of Civil Procedure (735 ILCS 5/2-1401 (West 2002)). The Second and Third Districts have held that a circuit court commits reversible error by dismissing a section 2-1401 petition without giving the defendant notice and an opportunity to respond to the circuit court's action and that the appellate court could not look beyond this error to assess the merits of the petition. People v. Coleman, 358 Ill.App.3d 1063, 1071, 296 Ill.Dec. 353, 835 N.E.2d 387 (3d Dist.2005); People v. Mescall, 347 Ill. App.3d 995, 283 Ill.Dec. 813, 808 N.E.2d 1101 (2d Dist.2004); People v. Pearson, 345 Ill.App.3d 191, 280 Ill.Dec. 461, 802 N.E.2d 386 (2d Dist.2003), aff'd on other grounds, 216 Ill.2d 58, 295 Ill.Dec. 621, 833 *971 N.E.2d 827 (2005); People v. Gaines, 335 Ill.App.3d 292, 269 Ill.Dec. 350, 780 N.E.2d 822 (2d Dist.2002); see People v. Winfrey, 347 Ill.App.3d 987, 989, 283 Ill.Dec. 623, 808 N.E.2d 589 (2d Dist.2004) (relied on Gaines and Pearson to find that the circuit court could not summarily dismiss a habeas corpus petition); People v. Shellstrom, 345 Ill.App.3d 175, 176-79, 280 Ill.Dec. 456, 802 N.E.2d 381 (2d Dist.2003) (determined that a summary dismissal of a mandamus petition was improper), aff'd on other grounds, 216 Ill.2d 45, 295 Ill.Dec. 657, 833 N.E.2d 863 (2005).
However, the Fourth District has come to the opposite conclusion, finding that a circuit court has the inherent authority to dismiss a section 2-1401 petition sua sponte if the court finds that the petition is frivolous and without merit. People v. Bramlett, 347 Ill.App.3d 468, 472-73, 282 Ill.Dec. 663, 806 N.E.2d 1251 (4th Dist. 2004); see Mason v. Snyder, 332 Ill. App.3d 834, 839-43, 266 Ill.Dec. 351, 774 N.E.2d 457 (4th Dist.2002) (determined that a summary dismissal of a mandamus petition was proper).
Some divisions of the First District have determined that a sua sponte dismissal of a section 2-1401 petition is appropriate. People v. Schrader, 353 Ill.App.3d 684, 289 Ill.Dec. 713, 820 N.E.2d 489 (1st Dist., 3d Div.2004) (determined that a summary dismissal of a section 2-1401 petition was proper where it raised only a pure question of law and that the circuit court had applied that law and determined that the challenge was frivolous and without merit); People v. Taylor, 349 Ill.App.3d 718, 285 Ill.Dec. 761, 812 N.E.2d 581 (1st Dist., 4th Div.2004) (determined that a sua sponte dismissal of the section 2-1401 petition was proper and stated that it was allowed to look beyond a procedural defect where the defendant's petition raised a pure question of law, was frivolous, and was without merit, and no prejudice resulted from the dismissal); see People v. Carroll, 351 Ill.App.3d 972, 287 Ill.Dec. 263, 815 N.E.2d 907 (1st Dist., 6th Div.2004) (determined that a summary denial of a habeas corpus petition was proper); Owens v. Snyder, 349 Ill.App.3d 35, 285 Ill.Dec. 251, 811 N.E.2d 738 (1st Dist., 2d Div.2004) (determined that a summary dismissal of a mandamus petition was proper where it was frivolous and the defendant was not prejudiced).
Other divisions of the First District have determined that it is unfair to a defendant, when faced with the proposed dismissal of his section 2-1401 petition, to be deprived of notice and an opportunity to respond. However, the courts ultimately determined that where the defects are patently incurable, it is harmless error to summarily dismiss the petition. People v. Anderson, 352 Ill.App.3d 934, 288 Ill.Dec. 350, 817 N.E.2d 1000 (1st Dist., 1st Div.2004); People v. Dyches, 355 Ill.App.3d 225, 291 Ill.Dec. 780, 824 N.E.2d 636 (1st Dist., 6th Div.2005).
We agree with the Fourth District's reasoning in Mason, 332 Ill.App.3d at 842, 266 Ill.Dec. 351, 774 N.E.2d 457, where the court determined that a circuit court has the authority to examine a mandamus petition and strike it sua sponte if the court finds that the petition is frivolous and without merit. The Mason court specifically noted, "[T]he trial courts, which have the inherent authority to control their courtrooms and their dockets, have the corollary authority to utilize their discretion in dealing with `professional litigants' who inappropriately burden the court system with nonmeritorious litigation, stemming from their unhappiness as [Department of Corrections] inmates." Mason, 332 Ill.App.3d at 842, 266 Ill.Dec. 351, 774 N.E.2d 457. We note that the circuit court's inherent power to protect itself *972 from frivolous and vexatious litigation has been recognized in other contexts. See Ronwin v. Piper, Jaffray & Hopwood, Inc., 113 Ill.App.3d 687, 693, 69 Ill.Dec. 519, 447 N.E.2d 954 (1983); Patterson v. Northern Trust Co., 286 Ill. 564, 567, 122 N.E. 55 (1919). Additionally, the circuit court has the authority to sua sponte dismiss proceedings that fail to present a recognizable cause of action. See Rhodes v. Mill Race Inn, Inc., 126 Ill.App.3d 1024, 1028, 81 Ill.Dec. 793, 467 N.E.2d 915 (1984).
Like mandamus, habeas corpus petitions are very limited. Habeas corpus relief can be utilized only to release a prisoner who has been incarcerated under a judgment of an original circuit court that lacked jurisdiction of the subject matter or the person of the defendant or where there has been some occurrence subsequent to the prisoner's conviction which entitles the prisoner to release. People ex rel. Shelley v. Frye, 42 Ill.2d 263, 246 N.E.2d 251 (1969).
In the instant case, based on the specific allegations of the petition, the defendant has not set forth a meritorious habeas corpus claim. His petition challenged the nature of his sentences. Habeas corpus is not an available remedy to review errors of a nonjurisdictional nature. People ex rel. Harper v. Brantley, 34 Ill. App.3d 807, 809, 341 N.E.2d 126 (1975). Additionally, nothing in the defendant's petition alleges a claim that he is otherwise entitled to a discharge. See People ex rel. Johnson v. Pate, 47 Ill.2d 172, 174, 265 N.E.2d 144 (1970) (habeas corpus is not available to a defendant not entitled to a final discharge).
Moreover, even though this is not a case under the Post-Conviction Hearing Act (Act) (725 ILCS 5/122-1 et seq. (West 2002)), section 122-2.1(a)(2) of the Act (725 ILCS 5/122-2.1(a)(2) (West 2002)) allows the dismissal of a postconviction petition that is frivolous or patently without merit before appointing counsel and allowing the State to respond. Courts have held that this procedure does not violate the petitioner's due process rights because it gives the petitioner an adequate opportunity to be heard. People v. Ross, 139 Ill.App.3d 674, 682, 94 Ill.Dec. 260, 487 N.E.2d 1137 (1985); People v. Baugh, 132 Ill.App.3d 713, 717, 87 Ill.Dec. 598, 477 N.E.2d 724 (1985). Likewise, we believe that the sua sponte dismissal of the defendant's habeas corpus petition in the instant case was proper.

CONCLUSION
For the foregoing reasons, we affirm the circuit court's summary dismissal of the defendant's habeas corpus petition.
Affirmed.
WELCH and CHAPMAN, JJ., concur.
